Share via


OpenAIClient Class

Definition

The OpenAI service client.

public class OpenAIClient
type OpenAIClient = class
Public Class OpenAIClient
Inheritance
OpenAIClient

Constructors

OpenAIClient()

Initializes a new instance of OpenAIClient for mocking.

OpenAIClient(String)

Initializes a instance of OpenAIClient for use with the non-Azure OpenAI endpoint.

OpenAIClient(String, OpenAIClientOptions)

Initializes a instance of OpenAIClient for use with the non-Azure OpenAI endpoint.

OpenAIClient(Uri, AzureKeyCredential)

Initializes a instance of OpenAIClient for use with an Azure OpenAI resource.

OpenAIClient(Uri, AzureKeyCredential, OpenAIClientOptions)

Initializes a instance of OpenAIClient for use with an Azure OpenAI resource.

OpenAIClient(Uri, TokenCredential) Initializes a instance of OpenAIClient for use with an Azure OpenAI resource.
OpenAIClient(Uri, TokenCredential, OpenAIClientOptions) Initializes a instance of OpenAIClient for use with an Azure OpenAI resource.

Properties

Pipeline

The HTTP pipeline for sending and receiving REST requests and responses.

Methods

GenerateSpeechFromText(SpeechGenerationOptions, CancellationToken)

Generates text-to-speech audio from the input text.

GenerateSpeechFromTextAsync(SpeechGenerationOptions, CancellationToken)

Generates text-to-speech audio from the input text.

GetAudioTranscription(AudioTranscriptionOptions, CancellationToken)

Transcribes audio into the input language.

GetAudioTranscriptionAsync(AudioTranscriptionOptions, CancellationToken)

Transcribes audio into the input language.

GetAudioTranslation(AudioTranslationOptions, CancellationToken)

Transcribes and translates input audio into English text.

GetAudioTranslationAsync(AudioTranslationOptions, CancellationToken)

Transcribes and translates input audio into English text.

GetChatCompletions(ChatCompletionsOptions, CancellationToken)

Get chat completions for provided chat context messages.

GetChatCompletionsAsync(ChatCompletionsOptions, CancellationToken)

Get chat completions for provided chat context messages.

GetChatCompletionsStreaming(ChatCompletionsOptions, CancellationToken)

Begin a chat completions request and get an object that can stream response data as it becomes available.

GetChatCompletionsStreamingAsync(ChatCompletionsOptions, CancellationToken)

Begin a chat completions request and get an object that can stream response data as it becomes available.

GetCompletions(CompletionsOptions, CancellationToken)

Return textual completions as configured for a given prompt.

GetCompletionsAsync(CompletionsOptions, CancellationToken)

Return textual completions as configured for a given prompt.

GetCompletionsStreaming(CompletionsOptions, CancellationToken)

Begin a completions request and get an object that can stream response data as it becomes available.

GetCompletionsStreamingAsync(CompletionsOptions, CancellationToken)

Begin a completions request and get an object that can stream response data as it becomes available.

GetEmbeddings(EmbeddingsOptions, CancellationToken)

Return the computed embeddings for a given prompt.

GetEmbeddingsAsync(EmbeddingsOptions, CancellationToken)

Return the computed embeddings for a given prompt.

GetImageGenerations(ImageGenerationOptions, CancellationToken)

Get a set of generated images influenced by a provided textual prompt.

GetImageGenerationsAsync(ImageGenerationOptions, CancellationToken)

Get a set of generated images influenced by a provided textual prompt.

Applies to