Search Results for

    Show / Hide Table of Contents

    Class OpenAIClient

    Represents the OpenAI service with methods to interact with the API.

    Inheritance
    object
    RESTClient
    ApiClient<OpenAIClient, Api, OpenAISettings>
    AIClient<OpenAIClient, OpenAISettings>
    OpenAIClient
    Implements
    IApiClient
    Inherited Members
    AIClient<OpenAIClient, OpenAISettings>.ResolveApiKey(string)
    AIClient<OpenAIClient, OpenAISettings>.GetVersion(string)
    AIClient<OpenAIClient, OpenAISettings>.ResolveBetaVersion(string)
    ApiClient<OpenAIClient, Api, OpenAISettings>.DefaultInstance
    ApiClient<OpenAIClient, Api, OpenAISettings>.Name
    ApiClient<OpenAIClient, Api, OpenAISettings>.BaseUrl
    ApiClient<OpenAIClient, Api, OpenAISettings>.Api
    ApiClient<OpenAIClient, Api, OpenAISettings>.BaseRequestParameters
    ApiClient<OpenAIClient, Api, OpenAISettings>.AdditionalHeaders
    ApiClient<OpenAIClient, Api, OpenAISettings>.RequiresApiKey
    ApiClient<OpenAIClient, Api, OpenAISettings>.Settings
    ApiClient<OpenAIClient, Api, OpenAISettings>.POSTAsync<TBody, TResponse>(ICrudService, string, TBody, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.POSTAsync<TBody>(ICrudService, string, TBody, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.POSTAsync<TResponse>(ICrudService, string, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.GETAsync(ICrudService, string, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.GETAsync<TResponse>(ICrudService, string, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.PUTAsync<TBody>(ICrudService, string, TBody, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.PATCHAsync<TResponse>(ICrudService, string, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.DELETEAsync<TBody, TStatus>(ICrudService, string, TBody, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.DELETEAsync<TStatus>(ICrudService, string, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.DELETEAsync(ICrudService, string, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.STREAMAsync<TBody, TDelta, TResult>(ICrudService, string, TBody, RequestOptions, IStreamPipeline<string, TDelta, TResult>, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.STREAMAsync<TBody, TDelta, TResult>(ICrudService, string, TBody, RequestOptions, IStreamPipeline<PooledBytes, TDelta, TResult>, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.STREAMAsync<TDelta, TResult>(ICrudService, string, RequestOptions, IStreamPipeline<string, TDelta, TResult>, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.STREAMAsync<TDelta, TResult>(ICrudService, string, RequestOptions, IStreamPipeline<PooledBytes, TDelta, TResult>, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.DownloadAsync(ICrudService, string, RequestOptions, params RequestParameter[])
    ApiClient<OpenAIClient, Api, OpenAISettings>.ValidateAuthAsync()
    ApiClient<OpenAIClient, Api, OpenAISettings>.ValidateEndpointAsync(string)
    RESTClient.Jss
    RESTClient.Xss
    RESTClient.Logger
    RESTClient.LogOptions
    RESTClient.Timeout
    RESTClient.ExceptionParser
    RESTClient.ExceptionHandler
    RESTClient.MaxRetryCount
    RESTClient.RetryDelaySeconds
    RESTClient.MaxRetryDelaySeconds
    RESTClient.DefaultFileMimeType
    RESTClient.DefaultDownloadDirectoryPath
    RESTClient.SetOnetimeLogOptions(CurlLogOptions)
    RESTClient.POSTAsync(RESTRequest)
    RESTClient.POSTAsync<T>(RESTRequest)
    RESTClient.PUTAsync(RESTRequest)
    RESTClient.PUTAsync<T>(RESTRequest)
    RESTClient.GETAsync<T>(RESTRequest)
    RESTClient.GETAsync(RESTRequest)
    RESTClient.DELETEAsync<T>(RESTRequest)
    RESTClient.DELETEAsync(RESTRequest)
    RESTClient.HEADAsync(RESTRequest)
    RESTClient.HEADAsync<T>(RESTRequest)
    RESTClient.PATCHAsync(RESTRequest)
    RESTClient.PATCHAsync<T>(RESTRequest)
    RESTClient.STREAMAsync<TDelta, TResult>(RESTRequest, IStreamPipeline<string, TDelta, TResult>, string)
    RESTClient.STREAMAsync<TDelta, TResult>(RESTRequest, IStreamPipeline<PooledBytes, TDelta, TResult>, string)
    RESTClient.DOWNLOADAsync(RESTRequest)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit.OpenAI
    Assembly: Glitch9.AIDevKit.Provider.OpenAI.dll
    Syntax
    public sealed class OpenAIClient : AIClient<OpenAIClient, OpenAISettings>, IApiClient

    Constructors

    | Edit this page View Source

    OpenAIClient()

    Declaration
    public OpenAIClient()

    Properties

    | Edit this page View Source

    Audio

    Learn how to turn audio into text or text into audio.

    Declaration
    public AudioService Audio { get; }
    Property Value
    Type Description
    AudioService
    | Edit this page View Source

    Batch

    Create large batches of API requests for asynchronous processing. The Batch API returns completions within 24 hours for a 50% discount.

    Declaration
    public BatchService Batch { get; }
    Property Value
    Type Description
    BatchService
    | Edit this page View Source

    Beta

    Beta features that are not yet available in the main API.

    Declaration
    public BetaService Beta { get; }
    Property Value
    Type Description
    BetaService
    | Edit this page View Source

    Chat

    Given a list of messages comprising a conversation, the model will return a response.

    Declaration
    public ChatService Chat { get; }
    Property Value
    Type Description
    ChatService
    | Edit this page View Source

    Conversations

    Declaration
    public ConversationService Conversations { get; }
    Property Value
    Type Description
    ConversationService
    | Edit this page View Source

    Embeddings

    Get a vector representation of a given input that can be easily consumed by machine learning models and algorithms.

    Declaration
    public EmbeddingService Embeddings { get; }
    Property Value
    Type Description
    EmbeddingService
    | Edit this page View Source

    Files

    Files are used to upload documents that can be used with features like Assistants, Fine-tuning, and Batch API.

    Declaration
    public FileService Files { get; }
    Property Value
    Type Description
    FileService
    | Edit this page View Source

    FineTuning

    Manage fine-tuning jobs to tailor a model to your specific training data.

    Declaration
    public FineTuningService FineTuning { get; }
    Property Value
    Type Description
    FineTuningService
    | Edit this page View Source

    Images

    Given a prompt and/or an input image, the model will generate a new image.

    Declaration
    public ImageService Images { get; }
    Property Value
    Type Description
    ImageService
    | Edit this page View Source

    Models

    List and describe the various models available in the API. You can refer to the Models documentation to understand what models are available and the differences between them.

    Declaration
    public ModelService Models { get; }
    Property Value
    Type Description
    ModelService
    | Edit this page View Source

    Moderations

    Given some input text, outputs if the model classifies it as potentially harmful across several categories.

    Declaration
    public ModerationService Moderations { get; }
    Property Value
    Type Description
    ModerationService
    | Edit this page View Source

    Responses

    Declaration
    public ResponseService Responses { get; }
    Property Value
    Type Description
    ResponseService
    | Edit this page View Source

    Videos

    Declaration
    public VideoService Videos { get; }
    Property Value
    Type Description
    VideoService
    | Edit this page View Source

    Voices

    Declaration
    public VoiceService Voices { get; }
    Property Value
    Type Description
    VoiceService

    Methods

    | Edit this page View Source

    CreateAdditionalHeaders()

    Override this to add more headers as needed.

    Declaration
    protected override List<HttpHeader> CreateAdditionalHeaders()
    Returns
    Type Description
    List<HttpHeader>
    Overrides
    ApiClient<OpenAIClient, Api, OpenAISettings>.CreateAdditionalHeaders()
    | Edit this page View Source

    CreateBaseRequestParameters()

    Creates the request parameters for API key, version, and beta version.

    Declaration
    protected override Dictionary<string, RequestParameter> CreateBaseRequestParameters()
    Returns
    Type Description
    Dictionary<string, RequestParameter>
    Overrides
    ApiClient<OpenAIClient, Api, OpenAISettings>.CreateBaseRequestParameters()
    | Edit this page View Source

    CreateJsonConverters()

    Override this to add more JsonConverters.

    Declaration
    protected override List<JsonConverter> CreateJsonConverters()
    Returns
    Type Description
    List<JsonConverter>
    Overrides
    AIClient<OpenAIClient, OpenAISettings>.CreateJsonConverters()
    | Edit this page View Source

    ResolveApiKey(string)

    Declaration
    public override string ResolveApiKey(string serviceName = null)
    Parameters
    Type Name Description
    string serviceName
    Returns
    Type Description
    string
    Overrides
    AIClient<OpenAIClient, OpenAISettings>.ResolveApiKey(string)
    | Edit this page View Source

    ResolveBetaVersion(string)

    Declaration
    public override string ResolveBetaVersion(string arg)
    Parameters
    Type Name Description
    string arg
    Returns
    Type Description
    string
    Overrides
    AIClient<OpenAIClient, OpenAISettings>.ResolveBetaVersion(string)

    Implements

    IApiClient

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation