diff --git a/src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsUpdate.g.cs b/src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsUpdate.g.cs new file mode 100644 index 0000000..1d181f3 --- /dev/null +++ b/src/libs/Replicate/Generated/Replicate.IReplicateApi.ModelsUpdate.g.cs @@ -0,0 +1,111 @@ +#nullable enable + +namespace Replicate +{ + public partial interface IReplicateApi + { + /// + /// Update metadata for a model
+ /// Update select properties of an existing model.
+ /// You can update the following properties:
+ /// - `description` - Model description
+ /// - `readme` - Model README content
+ /// - `github_url` - GitHub repository URL
+ /// - `paper_url` - Research paper URL
+ /// - `weights_url` - Model weights URL
+ /// - `license_url` - License URL
+ /// Example cURL request:
+ /// ```console
+ /// curl -X PATCH \
+ /// https://api.replicate.com/v1/models/your-username/your-model-name \
+ /// -H "Authorization: Token $REPLICATE_API_TOKEN" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{
+ /// "description": "Detect hot dogs in images",
+ /// "readme": "# Hot Dog Detector\n\n🌭 Ketchup, mustard, and onions...",
+ /// "github_url": "https://github.com/alice/hot-dog-detector",
+ /// "paper_url": "https://arxiv.org/abs/2504.17639",
+ /// "weights_url": "https://huggingface.co/alice/hot-dog-detector",
+ /// "license_url": "https://choosealicense.com/licenses/mit/"
+ /// }'
+ /// ```
+ /// The response will be the updated model object with all of its properties. + ///
+ /// + /// + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ModelsUpdateAsync( + string modelOwner, + string modelName, + global::Replicate.ModelsUpdateRequest request, + global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Update metadata for a model
+ /// Update select properties of an existing model.
+ /// You can update the following properties:
+ /// - `description` - Model description
+ /// - `readme` - Model README content
+ /// - `github_url` - GitHub repository URL
+ /// - `paper_url` - Research paper URL
+ /// - `weights_url` - Model weights URL
+ /// - `license_url` - License URL
+ /// Example cURL request:
+ /// ```console
+ /// curl -X PATCH \
+ /// https://api.replicate.com/v1/models/your-username/your-model-name \
+ /// -H "Authorization: Token $REPLICATE_API_TOKEN" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{
+ /// "description": "Detect hot dogs in images",
+ /// "readme": "# Hot Dog Detector\n\n🌭 Ketchup, mustard, and onions...",
+ /// "github_url": "https://github.com/alice/hot-dog-detector",
+ /// "paper_url": "https://arxiv.org/abs/2504.17639",
+ /// "weights_url": "https://huggingface.co/alice/hot-dog-detector",
+ /// "license_url": "https://choosealicense.com/licenses/mit/"
+ /// }'
+ /// ```
+ /// The response will be the updated model object with all of its properties. + ///
+ /// + /// + /// + /// A description of the model.
+ /// Example: Detect hot dogs in images + /// + /// + /// A URL for the model's source code on GitHub.
+ /// Example: https://github.com/alice/hot-dog-detector + /// + /// + /// A URL for the model's license. + /// + /// + /// A URL for the model's paper.
+ /// Example: https://arxiv.org/abs/2504.17639 + /// + /// + /// The README content of the model.
+ /// Example: # Updated README
+ /// New content here + /// + /// + /// A URL for the model's weights.
+ /// Example: https://huggingface.co/alice/hot-dog-detector + /// + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ModelsUpdateAsync( + string modelOwner, + string modelName, + string? description = default, + string? githubUrl = default, + string? licenseUrl = default, + string? paperUrl = default, + string? readme = default, + string? weightsUrl = default, + global::System.Threading.CancellationToken cancellationToken = default); + } +} \ No newline at end of file diff --git a/src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsGet.g.cs b/src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsGet.g.cs index d65f752..09d9f57 100644 --- a/src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.IReplicateApi.PredictionsGet.g.cs @@ -48,7 +48,7 @@ public partial interface IReplicateApi /// - `canceled`: the prediction was canceled by its creator.
/// In the case of success, `output` will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the `Authorization` header to request them.
/// In the case of failure, `error` will contain the error encountered during the prediction.
- /// Terminated predictions (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the prediction used while running. It won't include time waiting for the prediction to start.
+ /// Terminated predictions (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the prediction used while running. It won't include time waiting for the prediction to start. The `metrics` object will also include a `total_time` property showing the total time, in seconds, that the prediction took to complete.
/// All input parameters, output values, and logs are automatically removed after an hour, by default, for predictions created through the API.
/// You must save a copy of any data or files in the output if you'd like to continue using them. The `output` key will still be present, but it's value will be `null` after the output has been removed.
/// Output files are served by `replicate.delivery` and its subdomains. If you use an allow list of external domains for your assets, add `replicate.delivery` and `*.replicate.delivery` to it. diff --git a/src/libs/Replicate/Generated/Replicate.IReplicateApi.TrainingsGet.g.cs b/src/libs/Replicate/Generated/Replicate.IReplicateApi.TrainingsGet.g.cs index 09ea04e..d821b25 100644 --- a/src/libs/Replicate/Generated/Replicate.IReplicateApi.TrainingsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.IReplicateApi.TrainingsGet.g.cs @@ -50,7 +50,7 @@ public partial interface IReplicateApi /// - `canceled`: the training was canceled by its creator.
/// In the case of success, `output` will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the `Authorization` header to request them.
/// In the case of failure, `error` will contain the error encountered during the training.
- /// Terminated trainings (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the training used while running. It won't include time waiting for the training to start. + /// Terminated trainings (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the training used while running. It won't include time waiting for the training to start. The `metrics` object will also include a `total_time` property showing the total time, in seconds, that the training took to complete. /// /// /// The token to cancel the operation with diff --git a/src/libs/Replicate/Generated/Replicate.JsonSerializerContextTypes.g.cs b/src/libs/Replicate/Generated/Replicate.JsonSerializerContextTypes.g.cs index 24d52c6..71a467e 100644 --- a/src/libs/Replicate/Generated/Replicate.JsonSerializerContextTypes.g.cs +++ b/src/libs/Replicate/Generated/Replicate.JsonSerializerContextTypes.g.cs @@ -126,226 +126,234 @@ public sealed partial class JsonSerializerContextTypes /// /// /// - public global::Replicate.SchemasPredictionResponseStatus? Type25 { get; set; } + public global::Replicate.SchemasPredictionResponseMetrics? Type25 { get; set; } /// /// /// - public global::Replicate.SchemasPredictionResponseUrls? Type26 { get; set; } + public double? Type26 { get; set; } /// /// /// - public global::Replicate.OneOf? Type27 { get; set; } + public global::Replicate.SchemasPredictionResponseStatus? Type27 { get; set; } /// /// /// - public global::Replicate.SchemasPredictionResponseVersion? Type28 { get; set; } + public global::Replicate.SchemasPredictionResponseUrls? Type28 { get; set; } /// /// /// - public global::Replicate.SchemasPaginatedVersionResponse? Type29 { get; set; } + public global::Replicate.OneOf? Type29 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type30 { get; set; } + public global::Replicate.SchemasPredictionResponseVersion? Type30 { get; set; } /// /// /// - public global::Replicate.SchemasVersionResponse? Type31 { get; set; } + public global::Replicate.SchemasPaginatedVersionResponse? Type31 { get; set; } /// /// /// - public global::Replicate.SchemasPredictionRequest? Type32 { get; set; } + public global::System.Collections.Generic.IList? Type32 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type33 { get; set; } + public global::Replicate.SchemasVersionResponse? Type33 { get; set; } /// /// /// - public global::Replicate.SchemasPredictionRequestWebhookEventsFilterItem? Type34 { get; set; } + public global::Replicate.SchemasPredictionRequest? Type34 { get; set; } /// /// /// - public global::Replicate.SchemasSearchCollectionResponse? Type35 { get; set; } + public global::System.Collections.Generic.IList? Type35 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type36 { get; set; } + public global::Replicate.SchemasPredictionRequestWebhookEventsFilterItem? Type36 { get; set; } /// /// /// - public global::Replicate.SchemasSearchModelMetadataResponse? Type37 { get; set; } + public global::Replicate.SchemasSearchCollectionResponse? Type37 { get; set; } /// /// /// - public double? Type38 { get; set; } + public global::System.Collections.Generic.IList? Type38 { get; set; } /// /// /// - public global::Replicate.SchemasSearchResponse? Type39 { get; set; } + public global::Replicate.SchemasSearchModelMetadataResponse? Type39 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type40 { get; set; } + public global::Replicate.SchemasSearchResponse? Type40 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type41 { get; set; } + public global::System.Collections.Generic.IList? Type41 { get; set; } /// /// /// - public global::Replicate.SchemasSearchResponseModel? Type42 { get; set; } + public global::System.Collections.Generic.IList? Type42 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type43 { get; set; } + public global::Replicate.SchemasSearchResponseModel? Type43 { get; set; } /// /// /// - public global::Replicate.SchemasTrainingRequest? Type44 { get; set; } + public global::System.Collections.Generic.IList? Type44 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type45 { get; set; } + public global::Replicate.SchemasTrainingRequest? Type45 { get; set; } /// /// /// - public global::Replicate.SchemasTrainingRequestWebhookEventsFilterItem? Type46 { get; set; } + public global::System.Collections.Generic.IList? Type46 { get; set; } /// /// /// - public global::Replicate.SchemasTrainingResponse? Type47 { get; set; } + public global::Replicate.SchemasTrainingRequestWebhookEventsFilterItem? Type47 { get; set; } /// /// /// - public global::Replicate.SchemasTrainingResponseMetrics? Type48 { get; set; } + public global::Replicate.SchemasTrainingResponse? Type48 { get; set; } /// /// /// - public global::Replicate.SchemasTrainingResponseOutput? Type49 { get; set; } + public global::Replicate.SchemasTrainingResponseMetrics? Type49 { get; set; } /// /// /// - public global::Replicate.SchemasTrainingResponseSource? Type50 { get; set; } + public global::Replicate.SchemasTrainingResponseOutput? Type50 { get; set; } /// /// /// - public global::Replicate.SchemasTrainingResponseStatus? Type51 { get; set; } + public global::Replicate.SchemasTrainingResponseSource? Type51 { get; set; } /// /// /// - public global::Replicate.SchemasTrainingResponseUrls? Type52 { get; set; } + public global::Replicate.SchemasTrainingResponseStatus? Type52 { get; set; } /// /// /// - public global::Replicate.SchemasVersionPredictionRequest? Type53 { get; set; } + public global::Replicate.SchemasTrainingResponseUrls? Type53 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type54 { get; set; } + public global::Replicate.SchemasVersionPredictionRequest? Type54 { get; set; } /// /// /// - public global::Replicate.SchemasVersionPredictionRequestWebhookEventsFilterItem? Type55 { get; set; } + public global::System.Collections.Generic.IList? Type55 { get; set; } /// /// /// - public global::Replicate.DeploymentsCreateRequest? Type56 { get; set; } + public global::Replicate.SchemasVersionPredictionRequestWebhookEventsFilterItem? Type56 { get; set; } /// /// /// - public global::Replicate.DeploymentsUpdateRequest? Type57 { get; set; } + public global::Replicate.DeploymentsCreateRequest? Type57 { get; set; } /// /// /// - public global::Replicate.FilesCreateRequest? Type58 { get; set; } + public global::Replicate.DeploymentsUpdateRequest? Type58 { get; set; } /// /// /// - public byte[]? Type59 { get; set; } + public global::Replicate.FilesCreateRequest? Type59 { get; set; } /// /// /// - public global::Replicate.ModelsCreateRequest? Type60 { get; set; } + public byte[]? Type60 { get; set; } /// /// /// - public global::Replicate.ModelsCreateRequestVisibility? Type61 { get; set; } + public global::Replicate.ModelsCreateRequest? Type61 { get; set; } /// /// /// - public long? Type62 { get; set; } + public global::Replicate.ModelsCreateRequestVisibility? Type62 { get; set; } /// /// /// - public global::Replicate.AccountGetResponse? Type63 { get; set; } + public global::Replicate.ModelsUpdateRequest? Type63 { get; set; } /// /// /// - public global::Replicate.AccountGetResponseType? Type64 { get; set; } + public long? Type64 { get; set; } /// /// /// - public global::Replicate.DeploymentsListResponse? Type65 { get; set; } + public global::Replicate.AccountGetResponse? Type65 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type66 { get; set; } + public global::Replicate.AccountGetResponseType? Type66 { get; set; } /// /// /// - public global::Replicate.FilesListResponse? Type67 { get; set; } + public global::Replicate.DeploymentsListResponse? Type67 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type68 { get; set; } + public global::System.Collections.Generic.IList? Type68 { get; set; } /// /// /// - public global::Replicate.FilesCreateResponse? Type69 { get; set; } + public global::Replicate.FilesListResponse? Type69 { get; set; } /// /// /// - public global::Replicate.FilesDeleteResponse? Type70 { get; set; } + public global::System.Collections.Generic.IList? Type70 { get; set; } /// /// /// - public global::Replicate.FilesGetResponse? Type71 { get; set; } + public global::Replicate.FilesCreateResponse? Type71 { get; set; } /// /// /// - public global::Replicate.FilesDownloadResponse? Type72 { get; set; } + public global::Replicate.FilesDeleteResponse? Type72 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type73 { get; set; } + public global::Replicate.FilesGetResponse? Type73 { get; set; } /// /// /// - public global::Replicate.HardwareListResponseItem? Type74 { get; set; } + public global::Replicate.FilesDownloadResponse? Type74 { get; set; } /// /// /// - public global::Replicate.PredictionsListResponse? Type75 { get; set; } + public global::System.Collections.Generic.IList? Type75 { get; set; } /// /// /// - public global::Replicate.SearchResponse? Type76 { get; set; } + public global::Replicate.HardwareListResponseItem? Type76 { get; set; } /// /// /// - public global::Replicate.SearchResponse2? Type77 { get; set; } + public global::Replicate.PredictionsListResponse? Type77 { get; set; } /// /// /// - public global::Replicate.TrainingsListResponse? Type78 { get; set; } + public global::Replicate.SearchResponse? Type78 { get; set; } /// /// /// - public global::System.Collections.Generic.IList? Type79 { get; set; } + public global::Replicate.SearchResponse2? Type79 { get; set; } /// /// /// - public global::Replicate.WebhooksDefaultSecretGetResponse? Type80 { get; set; } + public global::Replicate.TrainingsListResponse? Type80 { get; set; } + /// + /// + /// + public global::System.Collections.Generic.IList? Type81 { get; set; } + /// + /// + /// + public global::Replicate.WebhooksDefaultSecretGetResponse? Type82 { get; set; } } } \ No newline at end of file diff --git a/src/libs/Replicate/Generated/Replicate.Models.ModelsUpdateRequest.Json.g.cs b/src/libs/Replicate/Generated/Replicate.Models.ModelsUpdateRequest.Json.g.cs new file mode 100644 index 0000000..4c5f85f --- /dev/null +++ b/src/libs/Replicate/Generated/Replicate.Models.ModelsUpdateRequest.Json.g.cs @@ -0,0 +1,92 @@ +#nullable enable + +namespace Replicate +{ + public sealed partial class ModelsUpdateRequest + { + /// + /// 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::Replicate.ModelsUpdateRequest? FromJson( + string json, + global::System.Text.Json.Serialization.JsonSerializerContext jsonSerializerContext) + { + return global::System.Text.Json.JsonSerializer.Deserialize( + json, + typeof(global::Replicate.ModelsUpdateRequest), + jsonSerializerContext) as global::Replicate.ModelsUpdateRequest; + } + + /// + /// 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::Replicate.ModelsUpdateRequest? 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::Replicate.ModelsUpdateRequest), + jsonSerializerContext).ConfigureAwait(false)) as global::Replicate.ModelsUpdateRequest; + } + + /// + /// 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/Replicate/Generated/Replicate.Models.ModelsUpdateRequest.g.cs b/src/libs/Replicate/Generated/Replicate.Models.ModelsUpdateRequest.g.cs new file mode 100644 index 0000000..74dd0bc --- /dev/null +++ b/src/libs/Replicate/Generated/Replicate.Models.ModelsUpdateRequest.g.cs @@ -0,0 +1,120 @@ + +#nullable enable + +namespace Replicate +{ + /// + /// + /// + public sealed partial class ModelsUpdateRequest + { + /// + /// A description of the model.
+ /// Example: Detect hot dogs in images + ///
+ /// Detect hot dogs in images + [global::System.Text.Json.Serialization.JsonPropertyName("description")] + public string? Description { get; set; } + + /// + /// A URL for the model's source code on GitHub.
+ /// Example: https://github.com/alice/hot-dog-detector + ///
+ /// https://github.com/alice/hot-dog-detector + [global::System.Text.Json.Serialization.JsonPropertyName("github_url")] + public string? GithubUrl { get; set; } + + /// + /// A URL for the model's license. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("license_url")] + public string? LicenseUrl { get; set; } + + /// + /// A URL for the model's paper.
+ /// Example: https://arxiv.org/abs/2504.17639 + ///
+ /// https://arxiv.org/abs/2504.17639 + [global::System.Text.Json.Serialization.JsonPropertyName("paper_url")] + public string? PaperUrl { get; set; } + + /// + /// The README content of the model.
+ /// Example: # Updated README
+ /// New content here + ///
+ /// + /// # Updated README
+ /// New content here + ///
+ [global::System.Text.Json.Serialization.JsonPropertyName("readme")] + public string? Readme { get; set; } + + /// + /// A URL for the model's weights.
+ /// Example: https://huggingface.co/alice/hot-dog-detector + ///
+ /// https://huggingface.co/alice/hot-dog-detector + [global::System.Text.Json.Serialization.JsonPropertyName("weights_url")] + public string? WeightsUrl { 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. + /// + /// + /// A description of the model.
+ /// Example: Detect hot dogs in images + /// + /// + /// A URL for the model's source code on GitHub.
+ /// Example: https://github.com/alice/hot-dog-detector + /// + /// + /// A URL for the model's license. + /// + /// + /// A URL for the model's paper.
+ /// Example: https://arxiv.org/abs/2504.17639 + /// + /// + /// The README content of the model.
+ /// Example: # Updated README
+ /// New content here + /// + /// + /// A URL for the model's weights.
+ /// Example: https://huggingface.co/alice/hot-dog-detector + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public ModelsUpdateRequest( + string? description, + string? githubUrl, + string? licenseUrl, + string? paperUrl, + string? readme, + string? weightsUrl) + { + this.Description = description; + this.GithubUrl = githubUrl; + this.LicenseUrl = licenseUrl; + this.PaperUrl = paperUrl; + this.Readme = readme; + this.WeightsUrl = weightsUrl; + } + + /// + /// Initializes a new instance of the class. + /// + public ModelsUpdateRequest() + { + } + } +} \ No newline at end of file diff --git a/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponse.g.cs b/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponse.g.cs index fc949c0..c4808be 100644 --- a/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponse.g.cs +++ b/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponse.g.cs @@ -67,7 +67,7 @@ public sealed partial class SchemasPredictionResponse /// Additional metrics associated with the prediction /// [global::System.Text.Json.Serialization.JsonPropertyName("metrics")] - public object? Metrics { get; set; } + public global::Replicate.SchemasPredictionResponseMetrics? Metrics { get; set; } /// /// The name of the model that created the prediction @@ -177,7 +177,7 @@ public SchemasPredictionResponse( global::System.DateTime? completedAt, string? deployment, string? logs, - object? metrics, + global::Replicate.SchemasPredictionResponseMetrics? metrics, global::System.DateTime? startedAt) { this.CreatedAt = createdAt; diff --git a/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseMetrics.g.cs b/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseMetrics.g.cs index 66f4796..d27263a 100644 --- a/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseMetrics.g.cs +++ b/src/libs/Replicate/Generated/Replicate.Models.SchemasPredictionResponseMetrics.g.cs @@ -8,11 +8,38 @@ namespace Replicate /// public sealed partial class SchemasPredictionResponseMetrics { + /// + /// The total time, in seconds, that the prediction took to complete + /// + [global::System.Text.Json.Serialization.JsonPropertyName("total_time")] + public double? TotalTime { get; set; } /// /// Additional properties that are not explicitly defined in the schema /// [global::System.Text.Json.Serialization.JsonExtensionData] public global::System.Collections.Generic.IDictionary AdditionalProperties { get; set; } = new global::System.Collections.Generic.Dictionary(); + + /// + /// Initializes a new instance of the class. + /// + /// + /// The total time, in seconds, that the prediction took to complete + /// +#if NET7_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] +#endif + public SchemasPredictionResponseMetrics( + double? totalTime) + { + this.TotalTime = totalTime; + } + + /// + /// Initializes a new instance of the class. + /// + public SchemasPredictionResponseMetrics() + { + } } } \ No newline at end of file diff --git a/src/libs/Replicate/Generated/Replicate.Models.SchemasTrainingResponseMetrics.g.cs b/src/libs/Replicate/Generated/Replicate.Models.SchemasTrainingResponseMetrics.g.cs index d7c9945..0580a76 100644 --- a/src/libs/Replicate/Generated/Replicate.Models.SchemasTrainingResponseMetrics.g.cs +++ b/src/libs/Replicate/Generated/Replicate.Models.SchemasTrainingResponseMetrics.g.cs @@ -14,6 +14,12 @@ public sealed partial class SchemasTrainingResponseMetrics [global::System.Text.Json.Serialization.JsonPropertyName("predict_time")] public double? PredictTime { get; set; } + /// + /// The total time, in seconds, that the training took to complete + /// + [global::System.Text.Json.Serialization.JsonPropertyName("total_time")] + public double? TotalTime { get; set; } + /// /// Additional properties that are not explicitly defined in the schema /// @@ -26,13 +32,18 @@ public sealed partial class SchemasTrainingResponseMetrics /// /// The amount of CPU or GPU time, in seconds, that the training used while running /// + /// + /// The total time, in seconds, that the training took to complete + /// #if NET7_0_OR_GREATER [global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers] #endif public SchemasTrainingResponseMetrics( - double? predictTime) + double? predictTime, + double? totalTime) { this.PredictTime = predictTime; + this.TotalTime = totalTime; } /// diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsUpdate.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsUpdate.g.cs new file mode 100644 index 0000000..54704ba --- /dev/null +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.ModelsUpdate.g.cs @@ -0,0 +1,287 @@ + +#nullable enable + +namespace Replicate +{ + public partial class ReplicateApi + { + partial void PrepareModelsUpdateArguments( + global::System.Net.Http.HttpClient httpClient, + ref string modelOwner, + ref string modelName, + global::Replicate.ModelsUpdateRequest request); + partial void PrepareModelsUpdateRequest( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpRequestMessage httpRequestMessage, + string modelOwner, + string modelName, + global::Replicate.ModelsUpdateRequest request); + partial void ProcessModelsUpdateResponse( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage); + + partial void ProcessModelsUpdateResponseContent( + global::System.Net.Http.HttpClient httpClient, + global::System.Net.Http.HttpResponseMessage httpResponseMessage, + ref string content); + + /// + /// Update metadata for a model
+ /// Update select properties of an existing model.
+ /// You can update the following properties:
+ /// - `description` - Model description
+ /// - `readme` - Model README content
+ /// - `github_url` - GitHub repository URL
+ /// - `paper_url` - Research paper URL
+ /// - `weights_url` - Model weights URL
+ /// - `license_url` - License URL
+ /// Example cURL request:
+ /// ```console
+ /// curl -X PATCH \
+ /// https://api.replicate.com/v1/models/your-username/your-model-name \
+ /// -H "Authorization: Token $REPLICATE_API_TOKEN" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{
+ /// "description": "Detect hot dogs in images",
+ /// "readme": "# Hot Dog Detector\n\n🌭 Ketchup, mustard, and onions...",
+ /// "github_url": "https://github.com/alice/hot-dog-detector",
+ /// "paper_url": "https://arxiv.org/abs/2504.17639",
+ /// "weights_url": "https://huggingface.co/alice/hot-dog-detector",
+ /// "license_url": "https://choosealicense.com/licenses/mit/"
+ /// }'
+ /// ```
+ /// The response will be the updated model object with all of its properties. + ///
+ /// + /// + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ModelsUpdateAsync( + string modelOwner, + string modelName, + global::Replicate.ModelsUpdateRequest request, + global::System.Threading.CancellationToken cancellationToken = default) + { + request = request ?? throw new global::System.ArgumentNullException(nameof(request)); + + PrepareArguments( + client: HttpClient); + PrepareModelsUpdateArguments( + httpClient: HttpClient, + modelOwner: ref modelOwner, + modelName: ref modelName, + request: request); + + var __pathBuilder = new global::Replicate.PathBuilder( + path: $"/models/{modelOwner}/{modelName}", + baseUri: HttpClient.BaseAddress); + var __path = __pathBuilder.ToString(); + using var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: new global::System.Net.Http.HttpMethod("PATCH"), + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in Authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2") + { + __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; + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareModelsUpdateRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + modelOwner: modelOwner, + modelName: modelName, + request: request); + + using var __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead, + cancellationToken: cancellationToken).ConfigureAwait(false); + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessModelsUpdateResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + + if (ReadResponseAsString) + { + var __content = await __response.Content.ReadAsStringAsync( +#if NET5_0_OR_GREATER + cancellationToken +#endif + ).ConfigureAwait(false); + + ProcessResponseContent( + client: HttpClient, + response: __response, + content: ref __content); + ProcessModelsUpdateResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Replicate.SchemasModelResponse.FromJson(__content, JsonSerializerContext) ?? + throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" "); + } + catch (global::System.Exception __ex) + { + throw new global::Replicate.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 + cancellationToken +#endif + ).ConfigureAwait(false); + + return + await global::Replicate.SchemasModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + throw new global::System.InvalidOperationException("Response deserialization failed."); + } + catch (global::System.Exception __ex) + { + throw new global::Replicate.ApiException( + message: __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + statusCode: __response.StatusCode) + { + ResponseHeaders = global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value), + }; + } + } + } + + /// + /// Update metadata for a model
+ /// Update select properties of an existing model.
+ /// You can update the following properties:
+ /// - `description` - Model description
+ /// - `readme` - Model README content
+ /// - `github_url` - GitHub repository URL
+ /// - `paper_url` - Research paper URL
+ /// - `weights_url` - Model weights URL
+ /// - `license_url` - License URL
+ /// Example cURL request:
+ /// ```console
+ /// curl -X PATCH \
+ /// https://api.replicate.com/v1/models/your-username/your-model-name \
+ /// -H "Authorization: Token $REPLICATE_API_TOKEN" \
+ /// -H "Content-Type: application/json" \
+ /// -d '{
+ /// "description": "Detect hot dogs in images",
+ /// "readme": "# Hot Dog Detector\n\n🌭 Ketchup, mustard, and onions...",
+ /// "github_url": "https://github.com/alice/hot-dog-detector",
+ /// "paper_url": "https://arxiv.org/abs/2504.17639",
+ /// "weights_url": "https://huggingface.co/alice/hot-dog-detector",
+ /// "license_url": "https://choosealicense.com/licenses/mit/"
+ /// }'
+ /// ```
+ /// The response will be the updated model object with all of its properties. + ///
+ /// + /// + /// + /// A description of the model.
+ /// Example: Detect hot dogs in images + /// + /// + /// A URL for the model's source code on GitHub.
+ /// Example: https://github.com/alice/hot-dog-detector + /// + /// + /// A URL for the model's license. + /// + /// + /// A URL for the model's paper.
+ /// Example: https://arxiv.org/abs/2504.17639 + /// + /// + /// The README content of the model.
+ /// Example: # Updated README
+ /// New content here + /// + /// + /// A URL for the model's weights.
+ /// Example: https://huggingface.co/alice/hot-dog-detector + /// + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task ModelsUpdateAsync( + string modelOwner, + string modelName, + string? description = default, + string? githubUrl = default, + string? licenseUrl = default, + string? paperUrl = default, + string? readme = default, + string? weightsUrl = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __request = new global::Replicate.ModelsUpdateRequest + { + Description = description, + GithubUrl = githubUrl, + LicenseUrl = licenseUrl, + PaperUrl = paperUrl, + Readme = readme, + WeightsUrl = weightsUrl, + }; + + return await ModelsUpdateAsync( + modelOwner: modelOwner, + modelName: modelName, + request: __request, + cancellationToken: cancellationToken).ConfigureAwait(false); + } + } +} \ No newline at end of file diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs index 0a85e81..23f4116 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.PredictionsGet.g.cs @@ -65,7 +65,7 @@ partial void ProcessPredictionsGetResponseContent( /// - `canceled`: the prediction was canceled by its creator.
/// In the case of success, `output` will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the `Authorization` header to request them.
/// In the case of failure, `error` will contain the error encountered during the prediction.
- /// Terminated predictions (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the prediction used while running. It won't include time waiting for the prediction to start.
+ /// Terminated predictions (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the prediction used while running. It won't include time waiting for the prediction to start. The `metrics` object will also include a `total_time` property showing the total time, in seconds, that the prediction took to complete.
/// All input parameters, output values, and logs are automatically removed after an hour, by default, for predictions created through the API.
/// You must save a copy of any data or files in the output if you'd like to continue using them. The `output` key will still be present, but it's value will be `null` after the output has been removed.
/// Output files are served by `replicate.delivery` and its subdomains. If you use an allow list of external domains for your assets, add `replicate.delivery` and `*.replicate.delivery` to it. diff --git a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.cs b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.cs index 1c99e0e..0b69487 100644 --- a/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.cs +++ b/src/libs/Replicate/Generated/Replicate.ReplicateApi.TrainingsGet.g.cs @@ -67,7 +67,7 @@ partial void ProcessTrainingsGetResponseContent( /// - `canceled`: the training was canceled by its creator.
/// In the case of success, `output` will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the `Authorization` header to request them.
/// In the case of failure, `error` will contain the error encountered during the training.
- /// Terminated trainings (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the training used while running. It won't include time waiting for the training to start. + /// Terminated trainings (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the training used while running. It won't include time waiting for the training to start. The `metrics` object will also include a `total_time` property showing the total time, in seconds, that the training took to complete. ///
/// /// The token to cancel the operation with diff --git a/src/libs/Replicate/openapi.yaml b/src/libs/Replicate/openapi.yaml index 17a64fa..7ccdf7a 100644 --- a/src/libs/Replicate/openapi.yaml +++ b/src/libs/Replicate/openapi.yaml @@ -591,6 +591,59 @@ paths: application/json: schema: $ref: '#/components/schemas/schemas_model_response' + patch: + summary: Update metadata for a model + description: "Update select properties of an existing model.\n\nYou can update the following properties:\n\n - `description` - Model description\n - `readme` - Model README content\n - `github_url` - GitHub repository URL\n - `paper_url` - Research paper URL\n - `weights_url` - Model weights URL\n - `license_url` - License URL\n\nExample cURL request:\n\n```console\ncurl -X PATCH \\\n https://api.replicate.com/v1/models/your-username/your-model-name \\\n -H \"Authorization: Token $REPLICATE_API_TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"description\": \"Detect hot dogs in images\",\n \"readme\": \"# Hot Dog Detector\\n\\n🌭 Ketchup, mustard, and onions...\",\n \"github_url\": \"https://github.com/alice/hot-dog-detector\",\n \"paper_url\": \"https://arxiv.org/abs/2504.17639\",\n \"weights_url\": \"https://huggingface.co/alice/hot-dog-detector\",\n \"license_url\": \"https://choosealicense.com/licenses/mit/\"\n }'\n```\n\nThe response will be the updated model object with all of its properties.\n" + operationId: models.update + parameters: + - name: model_owner + in: path + description: "The name of the user or organization that owns the model.\n" + required: true + schema: + type: string + - name: model_name + in: path + description: "The name of the model.\n" + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + description: + type: string + description: A description of the model. + example: Detect hot dogs in images + github_url: + type: string + description: A URL for the model's source code on GitHub. + example: https://github.com/alice/hot-dog-detector + license_url: + type: string + description: A URL for the model's license. + paper_url: + type: string + description: A URL for the model's paper. + example: https://arxiv.org/abs/2504.17639 + readme: + type: string + description: The README content of the model. + example: "# Updated README\n\nNew content here" + weights_url: + type: string + description: A URL for the model's weights. + example: https://huggingface.co/alice/hot-dog-detector + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/schemas_model_response' '/models/{model_owner}/{model_name}/examples': get: summary: List examples for a model @@ -872,7 +925,7 @@ paths: '/predictions/{prediction_id}': get: summary: Get a prediction - description: "Get the current state of a prediction.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer $REPLICATE_API_TOKEN\" \\\n https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\n```\n\nThe response will be the prediction object:\n\n```json\n{\n \"id\": \"gm3qorzdhgbfurvjtvhg6dckhu\",\n \"model\": \"replicate/hello-world\",\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"logs\": \"\",\n \"output\": \"hello Alice\",\n \"error\": null,\n \"status\": \"succeeded\",\n \"created_at\": \"2023-09-08T16:19:34.765994Z\",\n \"data_removed\": false,\n \"started_at\": \"2023-09-08T16:19:34.779176Z\",\n \"completed_at\": \"2023-09-08T16:19:34.791859Z\",\n \"metrics\": {\n \"predict_time\": 0.012683\n },\n \"urls\": {\n \"web\": \"https://replicate.com/p/gm3qorzdhgbfurvjtvhg6dckhu\",\n \"get\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\",\n \"cancel\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu/cancel\"\n }\n}\n```\n\n`status` will be one of:\n\n- `starting`: the prediction is starting up. If this status lasts longer than a few seconds, then it's typically because a new worker is being started to run the prediction.\n- `processing`: the `predict()` method of the model is currently running.\n- `succeeded`: the prediction completed successfully.\n- `failed`: the prediction encountered an error during processing.\n- `canceled`: the prediction was canceled by its creator.\n\nIn the case of success, `output` will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the `Authorization` header to request them.\n\nIn the case of failure, `error` will contain the error encountered during the prediction.\n\nTerminated predictions (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the prediction used while running. It won't include time waiting for the prediction to start.\n\nAll input parameters, output values, and logs are automatically removed after an hour, by default, for predictions created through the API.\n\nYou must save a copy of any data or files in the output if you'd like to continue using them. The `output` key will still be present, but it's value will be `null` after the output has been removed.\n\nOutput files are served by `replicate.delivery` and its subdomains. If you use an allow list of external domains for your assets, add `replicate.delivery` and `*.replicate.delivery` to it.\n" + description: "Get the current state of a prediction.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer $REPLICATE_API_TOKEN\" \\\n https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\n```\n\nThe response will be the prediction object:\n\n```json\n{\n \"id\": \"gm3qorzdhgbfurvjtvhg6dckhu\",\n \"model\": \"replicate/hello-world\",\n \"version\": \"5c7d5dc6dd8bf75c1acaa8565735e7986bc5b66206b55cca93cb72c9bf15ccaa\",\n \"input\": {\n \"text\": \"Alice\"\n },\n \"logs\": \"\",\n \"output\": \"hello Alice\",\n \"error\": null,\n \"status\": \"succeeded\",\n \"created_at\": \"2023-09-08T16:19:34.765994Z\",\n \"data_removed\": false,\n \"started_at\": \"2023-09-08T16:19:34.779176Z\",\n \"completed_at\": \"2023-09-08T16:19:34.791859Z\",\n \"metrics\": {\n \"predict_time\": 0.012683\n },\n \"urls\": {\n \"web\": \"https://replicate.com/p/gm3qorzdhgbfurvjtvhg6dckhu\",\n \"get\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu\",\n \"cancel\": \"https://api.replicate.com/v1/predictions/gm3qorzdhgbfurvjtvhg6dckhu/cancel\"\n }\n}\n```\n\n`status` will be one of:\n\n- `starting`: the prediction is starting up. If this status lasts longer than a few seconds, then it's typically because a new worker is being started to run the prediction.\n- `processing`: the `predict()` method of the model is currently running.\n- `succeeded`: the prediction completed successfully.\n- `failed`: the prediction encountered an error during processing.\n- `canceled`: the prediction was canceled by its creator.\n\nIn the case of success, `output` will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the `Authorization` header to request them.\n\nIn the case of failure, `error` will contain the error encountered during the prediction.\n\nTerminated predictions (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the prediction used while running. It won't include time waiting for the prediction to start. The `metrics` object will also include a `total_time` property showing the total time, in seconds, that the prediction took to complete.\n\nAll input parameters, output values, and logs are automatically removed after an hour, by default, for predictions created through the API.\n\nYou must save a copy of any data or files in the output if you'd like to continue using them. The `output` key will still be present, but it's value will be `null` after the output has been removed.\n\nOutput files are served by `replicate.delivery` and its subdomains. If you use an allow list of external domains for your assets, add `replicate.delivery` and `*.replicate.delivery` to it.\n" operationId: predictions.get parameters: - name: prediction_id @@ -1021,7 +1074,7 @@ paths: '/trainings/{training_id}': get: summary: Get a training - description: "Get the current state of a training.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer $REPLICATE_API_TOKEN\" \\\n https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga\n```\n\nThe response will be the training object:\n\n```json\n{\n \"completed_at\": \"2023-09-08T16:41:19.826523Z\",\n \"created_at\": \"2023-09-08T16:32:57.018467Z\",\n \"error\": null,\n \"id\": \"zz4ibbonubfz7carwiefibzgga\",\n \"input\": {\n \"input_images\": \"https://example.com/my-input-images.zip\"\n },\n \"logs\": \"...\",\n \"metrics\": {\n \"predict_time\": 502.713876\n },\n \"output\": {\n \"version\": \"...\",\n \"weights\": \"...\"\n },\n \"started_at\": \"2023-09-08T16:32:57.112647Z\",\n \"status\": \"succeeded\",\n \"urls\": {\n \"web\": \"https://replicate.com/p/zz4ibbonubfz7carwiefibzgga\",\n \"get\": \"https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga\",\n \"cancel\": \"https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga/cancel\"\n },\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n}\n```\n\n`status` will be one of:\n\n- `starting`: the training is starting up. If this status lasts longer than a few seconds, then it's typically because a new worker is being started to run the training.\n- `processing`: the `train()` method of the model is currently running.\n- `succeeded`: the training completed successfully.\n- `failed`: the training encountered an error during processing.\n- `canceled`: the training was canceled by its creator.\n\nIn the case of success, `output` will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the `Authorization` header to request them.\n\nIn the case of failure, `error` will contain the error encountered during the training.\n\nTerminated trainings (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the training used while running. It won't include time waiting for the training to start.\n" + description: "Get the current state of a training.\n\nExample cURL request:\n\n```console\ncurl -s \\\n -H \"Authorization: Bearer $REPLICATE_API_TOKEN\" \\\n https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga\n```\n\nThe response will be the training object:\n\n```json\n{\n \"completed_at\": \"2023-09-08T16:41:19.826523Z\",\n \"created_at\": \"2023-09-08T16:32:57.018467Z\",\n \"error\": null,\n \"id\": \"zz4ibbonubfz7carwiefibzgga\",\n \"input\": {\n \"input_images\": \"https://example.com/my-input-images.zip\"\n },\n \"logs\": \"...\",\n \"metrics\": {\n \"predict_time\": 502.713876\n },\n \"output\": {\n \"version\": \"...\",\n \"weights\": \"...\"\n },\n \"started_at\": \"2023-09-08T16:32:57.112647Z\",\n \"status\": \"succeeded\",\n \"urls\": {\n \"web\": \"https://replicate.com/p/zz4ibbonubfz7carwiefibzgga\",\n \"get\": \"https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga\",\n \"cancel\": \"https://api.replicate.com/v1/trainings/zz4ibbonubfz7carwiefibzgga/cancel\"\n },\n \"model\": \"stability-ai/sdxl\",\n \"version\": \"da77bc59ee60423279fd632efb4795ab731d9e3ca9705ef3341091fb989b7eaf\",\n}\n```\n\n`status` will be one of:\n\n- `starting`: the training is starting up. If this status lasts longer than a few seconds, then it's typically because a new worker is being started to run the training.\n- `processing`: the `train()` method of the model is currently running.\n- `succeeded`: the training completed successfully.\n- `failed`: the training encountered an error during processing.\n- `canceled`: the training was canceled by its creator.\n\nIn the case of success, `output` will be an object containing the output of the model. Any files will be represented as HTTPS URLs. You'll need to pass the `Authorization` header to request them.\n\nIn the case of failure, `error` will contain the error encountered during the training.\n\nTerminated trainings (with a status of `succeeded`, `failed`, or `canceled`) will include a `metrics` object with a `predict_time` property showing the amount of CPU or GPU time, in seconds, that the training used while running. It won't include time waiting for the training to start. The `metrics` object will also include a `total_time` property showing the total time, in seconds, that the training took to complete.\n" operationId: trainings.get parameters: - name: training_id @@ -1438,6 +1491,10 @@ components: description: The log output from the model metrics: type: object + properties: + total_time: + type: number + description: 'The total time, in seconds, that the prediction took to complete' description: Additional metrics associated with the prediction model: type: string @@ -1616,6 +1673,9 @@ components: predict_time: type: number description: 'The amount of CPU or GPU time, in seconds, that the training used while running' + total_time: + type: number + description: 'The total time, in seconds, that the training took to complete' description: Metrics about the training process model: type: string