Package com.azure.ai.openai
Class OpenAIAsyncClient
java.lang.Object
com.azure.ai.openai.OpenAIAsyncClient
Initializes a new instance of the asynchronous OpenAIClient type.
-
Method Summary
Modifier and TypeMethodDescriptiongetAudioTranscription(String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions) Gets transcribed text and associated metadata from provided spoken audio file data.getAudioTranscriptionAsPlainText(String deploymentOrModelName, AudioTranscriptionOptions audioTranscriptionOptions) Gets transcribed text and associated metadata from provided spoken audio data.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>>getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData audioTranscriptionOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets transcribed text and associated metadata from provided spoken audio data.getAudioTranscriptionAsResponseObject(String deploymentOrModelName, AudioTranscriptionOptions audioTranscriptionOptions) Gets transcribed text and associated metadata from provided spoken audio data.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>>getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData audioTranscriptionOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets transcribed text and associated metadata from provided spoken audio data.getAudioTranscriptionText(String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions) Gets transcribed text and associated metadata from provided spoken audio file data.getAudioTranscriptionTextWithResponse(String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets transcribed text and associated metadata from provided spoken audio file data.Mono<com.azure.core.http.rest.Response<AudioTranscription>>getAudioTranscriptionWithResponse(String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets transcribed text and associated metadata from provided spoken audio file data.getAudioTranslation(String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions) Gets English language transcribed text and associated metadata from provided spoken audio file data.getAudioTranslationAsPlainText(String deploymentOrModelName, AudioTranslationOptions audioTranslationOptions) Gets English language transcribed text and associated metadata from provided spoken audio data.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>>getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData audioTranslationOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets English language transcribed text and associated metadata from provided spoken audio data.getAudioTranslationAsResponseObject(String deploymentOrModelName, AudioTranslationOptions audioTranslationOptions) Gets English language transcribed text and associated metadata from provided spoken audio data.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>>getAudioTranslationAsResponseObjectWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData audioTranslationOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets English language transcribed text and associated metadata from provided spoken audio data.getAudioTranslationText(String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions) Gets English language transcribed text and associated metadata from provided spoken audio file data.getAudioTranslationTextWithResponse(String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets English language transcribed text and associated metadata from provided spoken audio file data.Mono<com.azure.core.http.rest.Response<AudioTranslation>>getAudioTranslationWithResponse(String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets English language transcribed text and associated metadata from provided spoken audio file data.getChatCompletions(String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions) Gets chat completions for the provided chat messages.getChatCompletionsStream(String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions) Gets chat completions for the provided chat messages.Mono<com.azure.core.http.rest.Response<ChatCompletions>>getChatCompletionsWithResponse(String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets chat completions for the provided chat messages.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>>getChatCompletionsWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData chatCompletionsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets chat completions for the provided chat messages.getCompletions(String deploymentOrModelName, CompletionsOptions completionsOptions) Gets completions for the provided input prompts.getCompletions(String deploymentOrModelName, String prompt) Gets completions for the provided input prompt.getCompletionsStream(String deploymentOrModelName, CompletionsOptions completionsOptions) Gets completions as a stream for the provided input prompts.Mono<com.azure.core.http.rest.Response<Completions>>getCompletionsWithResponse(String deploymentOrModelName, CompletionsOptions completionsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets completions for the provided input prompts.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>>getCompletionsWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData completionsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets completions for the provided input prompts.getEmbeddings(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions) Return the embeddings for a given prompt.Mono<com.azure.core.http.rest.Response<Embeddings>>getEmbeddingsWithResponse(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Return the embeddings for a given prompt.Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>>getEmbeddingsWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData embeddingsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Return the embeddings for a given prompt.getImages(ImageGenerationOptions imageGenerationOptions) Starts the generation of a batch of images from a text caption.
-
Method Details
-
getEmbeddingsWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getEmbeddingsWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData embeddingsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Return the embeddings for a given prompt.Request Body Schema
{ user: String (Optional) model: String (Optional) input (Required): [ String (Required) ] }Response Body Schema
{ data (Required): [ (Required){ embedding (Required): [ double (Required) ] index: int (Required) } ] usage (Required): { prompt_tokens: int (Required) total_tokens: int (Required) } }- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.embeddingsOptions- The configuration information for an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- representation of the response data from an embeddings request. Embeddings measure the relatedness of
text strings and are commonly used for search, clustering, recommendations, and other similar scenarios along
with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getCompletionsWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getCompletionsWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData completionsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets completions for the provided input prompts. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.Request Body Schema
{ prompt (Required): [ String (Required) ] max_tokens: Integer (Optional) temperature: Double (Optional) top_p: Double (Optional) logit_bias (Optional): { String: int (Optional) } user: String (Optional) n: Integer (Optional) logprobs: Integer (Optional) echo: Boolean (Optional) stop (Optional): [ String (Optional) ] presence_penalty: Double (Optional) frequency_penalty: Double (Optional) best_of: Integer (Optional) stream: Boolean (Optional) model: String (Optional) }Response Body Schema
{ id: String (Required) created: int (Required) choices (Required): [ (Required){ text: String (Required) index: int (Required) logprobs (Required): { tokens (Required): [ String (Required) ] token_logprobs (Required): [ double (Required) ] top_logprobs (Required): [ (Required){ String: double (Required) } ] text_offset (Required): [ int (Required) ] } finish_reason: String(stopped/tokenLimitReached/contentFiltered) (Required) } ] usage (Required): { completion_tokens: int (Required) prompt_tokens: int (Required) total_tokens: int (Required) } }- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.completionsOptions- The configuration information for a completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- completions for the provided input prompts. Completions support a wide variety of tasks and generate text
that continues from or "completes" provided prompt data along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getChatCompletionsWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getChatCompletionsWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData chatCompletionsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets chat completions for the provided chat messages. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.Request Body Schema
{ messages (Required): [ (Required){ role: String(system/assistant/user) (Required) content: String (Optional) } ] max_tokens: Integer (Optional) temperature: Double (Optional) top_p: Double (Optional) logit_bias (Optional): { String: int (Optional) } user: String (Optional) n: Integer (Optional) stop (Optional): [ String (Optional) ] presence_penalty: Double (Optional) frequency_penalty: Double (Optional) stream: Boolean (Optional) model: String (Optional) }Response Body Schema
{ id: String (Required) created: int (Required) choices (Required): [ (Required){ message (Optional): { role: String(system/assistant/user) (Required) content: String (Optional) } index: int (Required) finish_reason: String(stopped/tokenLimitReached/contentFiltered) (Required) delta (Optional): { role: String(system/assistant/user) (Optional) content: String (Optional) } } ] usage (Required): { completion_tokens: int (Required) prompt_tokens: int (Required) total_tokens: int (Required) } }- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.chatCompletionsOptions- The configuration information for a chat completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- chat completions for the provided chat messages. Completions support a wide variety of tasks and generate
text that continues from or "completes" provided prompt data along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getEmbeddingsWithResponse
public Mono<com.azure.core.http.rest.Response<Embeddings>> getEmbeddingsWithResponse(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Return the embeddings for a given prompt.Request Body Schema
{ user: String (Optional) model: String (Optional) input (Required): [ String (Required) ] }Response Body Schema
{ data (Required): [ (Required){ embedding (Required): [ double (Required) ] index: int (Required) } ] usage (Required): { prompt_tokens: int (Required) total_tokens: int (Required) } }- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.embeddingsOptions- The configuration information for an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- representation of the response data from an embeddings request. Embeddings measure the relatedness of
text strings and are commonly used for search, clustering, recommendations, and other similar scenarios along
with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getCompletionsWithResponse
public Mono<com.azure.core.http.rest.Response<Completions>> getCompletionsWithResponse(String deploymentOrModelName, CompletionsOptions completionsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets completions for the provided input prompts. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.Request Body Schema
{ prompt (Required): [ String (Required) ] max_tokens: Integer (Optional) temperature: Double (Optional) top_p: Double (Optional) logit_bias (Optional): { String: int (Optional) } user: String (Optional) n: Integer (Optional) logprobs: Integer (Optional) echo: Boolean (Optional) stop (Optional): [ String (Optional) ] presence_penalty: Double (Optional) frequency_penalty: Double (Optional) best_of: Integer (Optional) stream: Boolean (Optional) model: String (Optional) }Response Body Schema
{ id: String (Required) created: int (Required) choices (Required): [ (Required){ text: String (Required) index: int (Required) logprobs (Required): { tokens (Required): [ String (Required) ] token_logprobs (Required): [ double (Required) ] top_logprobs (Required): [ (Required){ String: double (Required) } ] text_offset (Required): [ int (Required) ] } finish_reason: String(stopped/tokenLimitReached/contentFiltered) (Required) } ] usage (Required): { completion_tokens: int (Required) prompt_tokens: int (Required) total_tokens: int (Required) } }- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.completionsOptions- The configuration information for a completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- completions for the provided input prompts. Completions support a wide variety of tasks and generate text
that continues from or "completes" provided prompt data along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getChatCompletionsWithResponse
public Mono<com.azure.core.http.rest.Response<ChatCompletions>> getChatCompletionsWithResponse(String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets chat completions for the provided chat messages. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.Request Body Schema
{ messages (Required): [ (Required){ role: String(system/assistant/user) (Required) content: String (Optional) } ] max_tokens: Integer (Optional) temperature: Double (Optional) top_p: Double (Optional) logit_bias (Optional): { String: int (Optional) } user: String (Optional) n: Integer (Optional) stop (Optional): [ String (Optional) ] presence_penalty: Double (Optional) frequency_penalty: Double (Optional) stream: Boolean (Optional) model: String (Optional) }Response Body Schema
{ id: String (Required) created: int (Required) choices (Required): [ (Required){ message (Optional): { role: String(system/assistant/user) (Required) content: String (Optional) } index: int (Required) finish_reason: String(stopped/tokenLimitReached/contentFiltered) (Required) delta (Optional): { role: String(system/assistant/user) (Optional) content: String (Optional) } } ] usage (Required): { completion_tokens: int (Required) prompt_tokens: int (Required) total_tokens: int (Required) } }- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.chatCompletionsOptions- The configuration information for a chat completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- chat completions for the provided chat messages. Completions support a wide variety of tasks and generate
text that continues from or "completes" provided prompt data along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getEmbeddings
public Mono<Embeddings> getEmbeddings(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions) Return the embeddings for a given prompt.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.embeddingsOptions- The configuration information for an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios.- Returns:
- representation of the response data from an embeddings request. Embeddings measure the relatedness of
text strings and are commonly used for search, clustering, recommendations, and other similar scenarios on
successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getCompletions
public Mono<Completions> getCompletions(String deploymentOrModelName, CompletionsOptions completionsOptions) Gets completions for the provided input prompts. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.completionsOptions- The configuration information for a completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Returns:
- completions for the provided input prompts. Completions support a wide variety of tasks and generate text
that continues from or "completes" provided prompt data on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getCompletions
Gets completions for the provided input prompt. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.prompt- The prompt to generate completion text from.- Returns:
- completions for the provided input prompts. Completions support a wide variety of tasks and generate text
that continues from or "completes" provided prompt data on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getCompletionsStream
public Flux<Completions> getCompletionsStream(String deploymentOrModelName, CompletionsOptions completionsOptions) Gets completions as a stream for the provided input prompts. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.completionsOptions- The configuration information for a completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Returns:
- a
Fluxof completions for the provided input prompts. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getChatCompletions
public Mono<ChatCompletions> getChatCompletions(String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions) Gets chat completions for the provided chat messages. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.chatCompletionsOptions- The configuration information for a chat completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Returns:
- chat completions for the provided chat messages. Completions support a wide variety of tasks and generate
text that continues from or "completes" provided prompt data on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getChatCompletionsStream
public Flux<ChatCompletions> getChatCompletionsStream(String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions) Gets chat completions for the provided chat messages. Chat completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.chatCompletionsOptions- The configuration information for a chat completions request. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.- Returns:
- chat completions stream for the provided chat messages. Completions support a wide variety of tasks and generate text that continues from or "completes" provided prompt data.
- Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getImages
Starts the generation of a batch of images from a text caption.- Parameters:
imageGenerationOptions- Represents the request data used to generate images.- Returns:
- the
Monowith the image generation result - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranscriptionAsResponseObjectWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData audioTranscriptionOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the written language corresponding to the language it was spoken in.Request Body Schema
{ file: byte[] (Required) response_format: String(json/verbose_json/text/srt/vtt) (Optional) language: String (Optional) prompt: String (Optional) temperature: Double (Optional) model: String (Optional) }Response Body Schema
{ text: String (Required) task: String(transcribe/translate) (Optional) language: String (Optional) duration: Double (Optional) segments (Optional): [ (Optional){ id: int (Required) start: double (Required) end: double (Required) text: String (Required) temperature: double (Required) avg_logprob: double (Required) compression_ratio: double (Required) no_speech_prob: double (Required) tokens (Required): [ int (Required) ] seek: int (Required) } ] }- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.audioTranscriptionOptions- The configuration information for an audio transcription request.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- transcribed text and associated metadata from provided spoken audio data along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getAudioTranscription
public Mono<AudioTranscription> getAudioTranscription(String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions) Gets transcribed text and associated metadata from provided spoken audio file data. Audio will be transcribed in the written language corresponding to the language it was spoken in.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.fileName- The file name that is represented in thefilefield ofAudioTranscriptionOptionsaudioTranscriptionOptions- The configuration information for an audio transcription request.- Returns:
AudioTranscriptiontranscribed text and associated metadata from provided spoken audio data on successful completion ofMono.- Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranscriptionWithResponse
public Mono<com.azure.core.http.rest.Response<AudioTranscription>> getAudioTranscriptionWithResponse(String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets transcribed text and associated metadata from provided spoken audio file data. Audio will be transcribed in the written language corresponding to the language it was spoken in.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.fileName- The file name that is represented in thefilefield ofAudioTranscriptionOptionsaudioTranscriptionOptions- The configuration information for an audio transcription request.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
AudioTranscriptiontranscribed text and associated metadata from provided spoken audio data on successful completion ofMono.- Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranscriptionText
public Mono<String> getAudioTranscriptionText(String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions) Gets transcribed text and associated metadata from provided spoken audio file data. Audio will be transcribed in the written language corresponding to the language it was spoken in.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.fileName- The file name that is represented in thefilefield ofAudioTranscriptionOptionsaudioTranscriptionOptions- The configuration information for an audio transcription request.- Returns:
- transcribed text and associated metadata from provided spoken audio data on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranscriptionTextWithResponse
public Mono<com.azure.core.http.rest.Response<String>> getAudioTranscriptionTextWithResponse(String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets transcribed text and associated metadata from provided spoken audio file data. Audio will be transcribed in the written language corresponding to the language it was spoken in.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.fileName- The file name that is represented in thefilefield ofAudioTranscriptionOptionsaudioTranscriptionOptions- The configuration information for an audio transcription request.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- transcribed text and associated metadata from provided spoken audio file data along with
Responseon successful completion ofMono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranslation
public Mono<AudioTranslation> getAudioTranslation(String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions) Gets English language transcribed text and associated metadata from provided spoken audio file data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.fileName- The file name that is represented in thefilefield ofAudioTranslationOptionsaudioTranslationOptions- The configuration information for an audio translation request.- Returns:
AudioTranslationenglish language transcribed text and associated metadata from provided spoken audio file data on successful completion ofMono.- Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranslationWithResponse
public Mono<com.azure.core.http.rest.Response<AudioTranslation>> getAudioTranslationWithResponse(String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets English language transcribed text and associated metadata from provided spoken audio file data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.fileName- The file name that is represented in thefilefield ofAudioTranslationOptionsaudioTranslationOptions- The configuration information for an audio translation request.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
AudioTranslationenglish language transcribed text and associated metadata from provided spoken audio file data along withResponseon successful completion ofMono.- Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranslationText
public Mono<String> getAudioTranslationText(String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions) Gets English language transcribed text and associated metadata from provided spoken audio file data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.fileName- The file name that is represented in thefilefield ofAudioTranslationOptions.audioTranslationOptions- The configuration information for an audio translation request.- Returns:
- english language transcribed text and associated metadata from provided spoken audio file data on
successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranslationTextWithResponse
public Mono<com.azure.core.http.rest.Response<String>> getAudioTranslationTextWithResponse(String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets English language transcribed text and associated metadata from provided spoken audio file data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.fileName- The file name that is represented in thefilefield ofAudioTranslationOptions.audioTranslationOptions- The configuration information for an audio translation request.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- english language transcribed text and associated metadata from provided spoken audio file data on
successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranscriptionAsPlainTextWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData audioTranscriptionOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the written language corresponding to the language it was spoken in.Request Body Schema
{ file: byte[] (Required) response_format: String(json/verbose_json/text/srt/vtt) (Optional) language: String (Optional) prompt: String (Optional) temperature: Double (Optional) model: String (Optional) }Response Body Schema
String- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.audioTranscriptionOptions- The configuration information for an audio transcription request.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- transcribed text and associated metadata from provided spoken audio data along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getAudioTranslationAsResponseObjectWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getAudioTranslationAsResponseObjectWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData audioTranslationOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets English language transcribed text and associated metadata from provided spoken audio data.Request Body Schema
{ file: byte[] (Required) response_format: String(json/verbose_json/text/srt/vtt) (Optional) prompt: String (Optional) temperature: Double (Optional) model: String (Optional) }Response Body Schema
{ text: String (Required) task: String(transcribe/translate) (Optional) language: String (Optional) duration: Double (Optional) segments (Optional): [ (Optional){ id: int (Required) start: double (Required) end: double (Required) text: String (Required) temperature: double (Required) avg_logprob: double (Required) compression_ratio: double (Required) no_speech_prob: double (Required) tokens (Required): [ int (Required) ] seek: int (Required) } ] }- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.audioTranslationOptions- The configuration information for an audio translation request.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- english language transcribed text and associated metadata from provided spoken audio data along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getAudioTranslationAsPlainTextWithResponse
public Mono<com.azure.core.http.rest.Response<com.azure.core.util.BinaryData>> getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, com.azure.core.util.BinaryData audioTranslationOptions, com.azure.core.http.rest.RequestOptions requestOptions) Gets English language transcribed text and associated metadata from provided spoken audio data.Request Body Schema
{ file: byte[] (Required) response_format: String(json/verbose_json/text/srt/vtt) (Optional) prompt: String (Optional) temperature: Double (Optional) model: String (Optional) }Response Body Schema
String- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.audioTranslationOptions- The configuration information for an audio translation request.requestOptions- The options to configure the HTTP request before HTTP client sends it.- Returns:
- english language transcribed text and associated metadata from provided spoken audio data along with
Responseon successful completion ofMono. - Throws:
com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.
-
getAudioTranscriptionAsResponseObject
public Mono<AudioTranscription> getAudioTranscriptionAsResponseObject(String deploymentOrModelName, AudioTranscriptionOptions audioTranscriptionOptions) Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the written language corresponding to the language it was spoken in.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.audioTranscriptionOptions- The configuration information for an audio transcription request.- Returns:
- transcribed text and associated metadata from provided spoken audio data on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranscriptionAsPlainText
public Mono<String> getAudioTranscriptionAsPlainText(String deploymentOrModelName, AudioTranscriptionOptions audioTranscriptionOptions) Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the written language corresponding to the language it was spoken in.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.audioTranscriptionOptions- The configuration information for an audio transcription request.- Returns:
- transcribed text and associated metadata from provided spoken audio data on successful completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranslationAsResponseObject
public Mono<AudioTranslation> getAudioTranslationAsResponseObject(String deploymentOrModelName, AudioTranslationOptions audioTranslationOptions) Gets English language transcribed text and associated metadata from provided spoken audio data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.audioTranslationOptions- The configuration information for an audio translation request.- Returns:
- english language transcribed text and associated metadata from provided spoken audio data on successful
completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-
getAudioTranslationAsPlainText
public Mono<String> getAudioTranslationAsPlainText(String deploymentOrModelName, AudioTranslationOptions audioTranslationOptions) Gets English language transcribed text and associated metadata from provided spoken audio data.- Parameters:
deploymentOrModelName- Specifies either the model deployment name (when using Azure OpenAI) or model name (when using non-Azure OpenAI) to use for this request.audioTranslationOptions- The configuration information for an audio translation request.- Returns:
- english language transcribed text and associated metadata from provided spoken audio data on successful
completion of
Mono. - Throws:
IllegalArgumentException- thrown if parameters fail the validation.com.azure.core.exception.HttpResponseException- thrown if the request is rejected by server.com.azure.core.exception.ClientAuthenticationException- thrown if the request is rejected by server on status code 401.com.azure.core.exception.ResourceNotFoundException- thrown if the request is rejected by server on status code 404.com.azure.core.exception.ResourceModifiedException- thrown if the request is rejected by server on status code 409.RuntimeException- all other wrapped checked exceptions if the request fails to be sent.
-