diff --git a/OpenAI-DotNet/Batch/BatchOutputFolder.cs b/OpenAI-DotNet/Batch/BatchOutputFolder.cs new file mode 100644 index 00000000..d5898046 --- /dev/null +++ b/OpenAI-DotNet/Batch/BatchOutputFolder.cs @@ -0,0 +1,13 @@ +using System.Text.Json.Serialization; + +namespace OpenAI.Batch +{ + public sealed class BatchOutputFolder + { + /// + /// The URL of the blob storage folder where the batch output will be written. + /// + [JsonPropertyName("url")] + public string Url { get; set; } + } +} diff --git a/OpenAI-DotNet/Batch/BatchResponse.cs b/OpenAI-DotNet/Batch/BatchResponse.cs index 5cc1acec..ed919aaf 100644 --- a/OpenAI-DotNet/Batch/BatchResponse.cs +++ b/OpenAI-DotNet/Batch/BatchResponse.cs @@ -186,6 +186,27 @@ public DateTime? CancelledAt [JsonPropertyName("metadata")] public IReadOnlyDictionary Metadata { get; private set; } + /// + /// The URL of the blob storage location where any errors encountered during processing will be written. + /// + [JsonInclude] + [JsonPropertyName("error_blob")] + public string ErrorBlob { get; private set; } + + /// + /// The URL of the blob storage location where the batch output will be written. + /// + [JsonInclude] + [JsonPropertyName("output_blob")] + public string OutputBlob { get; private set; } + + /// + /// The URL of the blob storage location where the batch input was read from. + /// + [JsonInclude] + [JsonPropertyName("input_blob")] + public string InputBlob { get; private set; } + public override string ToString() => Id; public static implicit operator string(BatchResponse response) => response?.ToString(); diff --git a/OpenAI-DotNet/Batch/CreateBatchRequest.cs b/OpenAI-DotNet/Batch/CreateBatchRequest.cs index de9d9871..72376062 100644 --- a/OpenAI-DotNet/Batch/CreateBatchRequest.cs +++ b/OpenAI-DotNet/Batch/CreateBatchRequest.cs @@ -44,5 +44,11 @@ public CreateBatchRequest(string inputFileId, string endpoint, IReadOnlyDictiona [JsonPropertyName("metadata")] public IReadOnlyDictionary Metadata { get; } + + [JsonPropertyName("input_blob")] + public string InputBlob { get; set; } + + [JsonPropertyName("output_folder")] + public BatchOutputFolder OutputFolder { get; set; } } }