OpenAIClient Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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) |
|
OpenAIClient(Uri, TokenCredential, OpenAIClientOptions) |
|
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
Azure SDK for .NET
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for