From 54b63eb05d3fd67c7aa43b9738c050932cec05fb Mon Sep 17 00:00:00 2001 From: Alec Chan Date: Thu, 16 Oct 2025 10:30:39 -0700 Subject: [PATCH 1/2] Add Azure Blob Batch API compatible fields to schema --- OpenAI-DotNet/Batch/BatchOutputFolder.cs | 14 ++++++++++++++ OpenAI-DotNet/Batch/BatchResponse.cs | 21 +++++++++++++++++++++ OpenAI-DotNet/Batch/CreateBatchRequest.cs | 6 ++++++ 3 files changed, 41 insertions(+) create mode 100644 OpenAI-DotNet/Batch/BatchOutputFolder.cs diff --git a/OpenAI-DotNet/Batch/BatchOutputFolder.cs b/OpenAI-DotNet/Batch/BatchOutputFolder.cs new file mode 100644 index 00000000..ead2a7c2 --- /dev/null +++ b/OpenAI-DotNet/Batch/BatchOutputFolder.cs @@ -0,0 +1,14 @@ +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; } } } From f98deea309d32782ebb57cfb5adf82154a4e7721 Mon Sep 17 00:00:00 2001 From: Alec Chan <34929371+aechan@users.noreply.github.com> Date: Thu, 16 Oct 2025 10:36:44 -0700 Subject: [PATCH 2/2] Update OpenAI-DotNet/Batch/BatchOutputFolder.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- OpenAI-DotNet/Batch/BatchOutputFolder.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/OpenAI-DotNet/Batch/BatchOutputFolder.cs b/OpenAI-DotNet/Batch/BatchOutputFolder.cs index ead2a7c2..d5898046 100644 --- a/OpenAI-DotNet/Batch/BatchOutputFolder.cs +++ b/OpenAI-DotNet/Batch/BatchOutputFolder.cs @@ -7,7 +7,6 @@ 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; } }