Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions OpenAI-DotNet/Batch/BatchOutputFolder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Text.Json.Serialization;

namespace OpenAI.Batch
{
public sealed class BatchOutputFolder
{
/// <summary>
/// The URL of the blob storage folder where the batch output will be written.
/// </summary>
/// <value></value>
[JsonPropertyName("url")]
public string Url { get; set; }
}
}
21 changes: 21 additions & 0 deletions OpenAI-DotNet/Batch/BatchResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,27 @@ public DateTime? CancelledAt
[JsonPropertyName("metadata")]
public IReadOnlyDictionary<string, object> Metadata { get; private set; }

/// <summary>
/// The URL of the blob storage location where any errors encountered during processing will be written.
/// </summary>
[JsonInclude]
[JsonPropertyName("error_blob")]
public string ErrorBlob { get; private set; }

/// <summary>
/// The URL of the blob storage location where the batch output will be written.
/// </summary>
[JsonInclude]
[JsonPropertyName("output_blob")]
public string OutputBlob { get; private set; }

/// <summary>
/// The URL of the blob storage location where the batch input was read from.
/// </summary>
[JsonInclude]
[JsonPropertyName("input_blob")]
public string InputBlob { get; private set; }

public override string ToString() => Id;

public static implicit operator string(BatchResponse response) => response?.ToString();
Expand Down
6 changes: 6 additions & 0 deletions OpenAI-DotNet/Batch/CreateBatchRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@ public CreateBatchRequest(string inputFileId, string endpoint, IReadOnlyDictiona

[JsonPropertyName("metadata")]
public IReadOnlyDictionary<string, object> Metadata { get; }

[JsonPropertyName("input_blob")]
public string InputBlob { get; set; }

[JsonPropertyName("output_folder")]
public BatchOutputFolder OutputFolder { get; set; }
Comment on lines +49 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be set in constructor, but I can handle that tweak

}
}