openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.4.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Generated/BatchClient.cs

41lines · modepreview

// <auto-generated/>

#nullable disable

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
using OpenAI;

namespace OpenAI.Batch
{
    [Experimental("OPENAI001")]
    public partial class BatchClient
    {
        private readonly Uri _endpoint;

        protected BatchClient()
        {
        }

        public ClientPipeline Pipeline { get; }

        public virtual ClientResult GetBatch(string batchId, RequestOptions options)
        {
            Argument.AssertNotNullOrEmpty(batchId, nameof(batchId));

            using PipelineMessage message = CreateGetBatchRequest(batchId, options);
            return ClientResult.FromResponse(Pipeline.ProcessMessage(message, options));
        }

        public virtual async Task<ClientResult> GetBatchAsync(string batchId, RequestOptions options)
        {
            Argument.AssertNotNullOrEmpty(batchId, nameof(batchId));

            using PipelineMessage message = CreateGetBatchRequest(batchId, options);
            return ClientResult.FromResponse(await Pipeline.ProcessMessageAsync(message, options).ConfigureAwait(false));
        }
    }
}