openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
src/Generated/BatchClient.cs
41lines · modecode
| 1 | // <auto-generated/> |
| 2 | |
| 3 | #nullable disable |
| 4 | |
| 5 | using System; |
| 6 | using System.ClientModel; |
| 7 | using System.ClientModel.Primitives; |
| 8 | using System.Diagnostics.CodeAnalysis; |
| 9 | using System.Threading.Tasks; |
| 10 | using OpenAI; |
| 11 | |
| 12 | namespace OpenAI.Batch |
| 13 | { |
| 14 | [Experimental("OPENAI001")] |
| 15 | public partial class BatchClient |
| 16 | { |
| 17 | private readonly Uri _endpoint; |
| 18 | |
| 19 | protected BatchClient() |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | public ClientPipeline Pipeline { get; } |
| 24 | |
| 25 | public virtual ClientResult GetBatch(string batchId, RequestOptions options) |
| 26 | { |
| 27 | Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); |
| 28 | |
| 29 | using PipelineMessage message = CreateGetBatchRequest(batchId, options); |
| 30 | return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options)); |
| 31 | } |
| 32 | |
| 33 | public virtual async Task<ClientResult> GetBatchAsync(string batchId, RequestOptions options) |
| 34 | { |
| 35 | Argument.AssertNotNullOrEmpty(batchId, nameof(batchId)); |
| 36 | |
| 37 | using PipelineMessage message = CreateGetBatchRequest(batchId, options); |
| 38 | return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false)); |
| 39 | } |
| 40 | } |
| 41 | } |