diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java index 30b57196bfd9..3a2237dc093b 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/OpenAIClientImpl.java @@ -153,7 +153,7 @@ public OpenAIClientImpl( @Host("{endpoint}/openai") @ServiceInterface(name = "OpenAIClient") public interface OpenAIClientService { - @Post("/deployments/{deploymentId}/embeddings") + @Post("/deployments/{deploymentId}/audio/transcriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -165,16 +165,16 @@ public interface OpenAIClientService { value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getEmbeddings( + Mono> getAudioTranscriptionAsPlainText( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData embeddingsOptions, + @BodyParam("application/json") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/embeddings") + @Post("/deployments/{deploymentId}/audio/transcriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -186,16 +186,17 @@ Mono> getEmbeddings( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getEmbeddingsSync( + Response getAudioTranscriptionAsPlainTextSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData embeddingsOptions, + @BodyParam("application/json") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/completions") + // @Multipart not supported by RestProxy + @Post("/deployments/{deploymentId}/audio/transcriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -207,16 +208,18 @@ Response getEmbeddingsSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCompletions( + Mono> getAudioTranscriptionAsResponseObject( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData completionsOptions, + @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/completions") + // @Multipart not supported by RestProxy + @Post("/deployments/{deploymentId}/audio/transcriptions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -228,16 +231,17 @@ Mono> getCompletions( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getCompletionsSync( + Response getAudioTranscriptionAsResponseObjectSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData completionsOptions, + @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/chat/completions") + @Post("/deployments/{deploymentId}/audio/translations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -249,16 +253,16 @@ Response getCompletionsSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getChatCompletions( + Mono> getAudioTranslationAsPlainText( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData chatCompletionsOptions, + @BodyParam("application/json") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/chat/completions") + @Post("/deployments/{deploymentId}/audio/translations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -270,16 +274,17 @@ Mono> getChatCompletions( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getChatCompletionsSync( + Response getAudioTranslationAsPlainTextSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData chatCompletionsOptions, + @BodyParam("application/json") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/extensions/chat/completions") + // @Multipart not supported by RestProxy + @Post("/deployments/{deploymentId}/audio/translations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -291,16 +296,18 @@ Response getChatCompletionsSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getChatCompletionsWithAzureExtensions( + Mono> getAudioTranslationAsResponseObject( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData chatCompletionsOptions, + @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/extensions/chat/completions") + // @Multipart not supported by RestProxy + @Post("/deployments/{deploymentId}/audio/translations") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -312,17 +319,18 @@ Mono> getChatCompletionsWithAzureExtensions( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getChatCompletionsWithAzureExtensionsSync( + Response getAudioTranslationAsResponseObjectSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData chatCompletionsOptions, + @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, Context context); - @Post("/images/generations:submit") - @ExpectedResponses({202}) + @Post("/deployments/{deploymentId}/completions") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -333,16 +341,17 @@ Response getChatCompletionsWithAzureExtensionsSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> beginAzureBatchImageGeneration( + Mono> getCompletions( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData imageGenerationOptions, + @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions, Context context); - @Post("/images/generations:submit") - @ExpectedResponses({202}) + @Post("/deployments/{deploymentId}/completions") + @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -353,15 +362,16 @@ Mono> beginAzureBatchImageGeneration( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response beginAzureBatchImageGenerationSync( + Response getCompletionsSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData imageGenerationOptions, + @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/audio/transcriptions") + @Post("/deployments/{deploymentId}/chat/completions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -373,16 +383,16 @@ Response beginAzureBatchImageGenerationSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAudioTranscriptionAsPlainText( + Mono> getChatCompletions( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData audioTranscriptionOptions, + @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/audio/transcriptions") + @Post("/deployments/{deploymentId}/chat/completions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -394,17 +404,16 @@ Mono> getAudioTranscriptionAsPlainText( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAudioTranscriptionAsPlainTextSync( + Response getChatCompletionsSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData audioTranscriptionOptions, + @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy - @Post("/deployments/{deploymentId}/audio/transcriptions") + @Post("/deployments/{deploymentId}/extensions/chat/completions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -416,18 +425,16 @@ Response getAudioTranscriptionAsPlainTextSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAudioTranscriptionAsResponseObject( + Mono> getChatCompletionsWithAzureExtensions( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, + @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy - @Post("/deployments/{deploymentId}/audio/transcriptions") + @Post("/deployments/{deploymentId}/extensions/chat/completions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -439,18 +446,17 @@ Mono> getAudioTranscriptionAsResponseObject( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAudioTranscriptionAsResponseObjectSync( + Response getChatCompletionsWithAzureExtensionsSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, + @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/audio/translations") - @ExpectedResponses({200}) + @Post("/images/generations:submit") + @ExpectedResponses({202}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -461,17 +467,16 @@ Response getAudioTranscriptionAsResponseObjectSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAudioTranslationAsPlainText( + Mono> beginAzureBatchImageGeneration( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData audioTranslationOptions, + @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/audio/translations") - @ExpectedResponses({200}) + @Post("/images/generations:submit") + @ExpectedResponses({202}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, code = {401}) @@ -482,17 +487,15 @@ Mono> getAudioTranslationAsPlainText( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAudioTranslationAsPlainTextSync( + Response beginAzureBatchImageGenerationSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData audioTranslationOptions, + @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy - @Post("/deployments/{deploymentId}/audio/translations") + @Post("/deployments/{deploymentId}/embeddings") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -504,18 +507,16 @@ Response getAudioTranslationAsPlainTextSync( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAudioTranslationAsResponseObject( + Mono> getEmbeddings( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, + @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy - @Post("/deployments/{deploymentId}/audio/translations") + @Post("/deployments/{deploymentId}/embeddings") @ExpectedResponses({200}) @UnexpectedResponseExceptionType( value = ClientAuthenticationException.class, @@ -527,171 +528,126 @@ Mono> getAudioTranslationAsResponseObject( value = ResourceModifiedException.class, code = {409}) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAudioTranslationAsResponseObjectSync( + Response getEmbeddingsSync( @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("content-type") String contentType, @HeaderParam("accept") String accept, - @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, + @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, Context context); } /** - * Return the embeddings for a given prompt. + * 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 * *

{@code
      * {
-     *     user: String (Optional)
+     *     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)
-     *     input (Required): [
-     *         String (Required)
-     *     ]
      * }
      * }
* *

Response Body Schema * *

{@code
-     * {
-     *     data (Required): [
-     *          (Required){
-     *             embedding (Required): [
-     *                 double (Required)
-     *             ]
-     *             index: int (Required)
-     *         }
-     *     ]
-     *     usage (Required): {
-     *         prompt_tokens: int (Required)
-     *         total_tokens: int (Required)
-     *     }
-     * }
+     * String
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param 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. + * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 {@link Response} on successful completion of {@link Mono}. + * @return transcribed text and associated metadata from provided spoken audio data along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getEmbeddingsWithResponseAsync( - String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { + public Mono> getAudioTranscriptionAsPlainTextWithResponseAsync( + String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getEmbeddings( + service.getAudioTranscriptionAsPlainText( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, accept, - embeddingsOptions, + audioTranscriptionOptions, requestOptions, context)); } /** - * Return the embeddings for a given prompt. + * 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 * *

{@code
      * {
-     *     user: String (Optional)
+     *     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)
-     *     input (Required): [
-     *         String (Required)
-     *     ]
      * }
      * }
* *

Response Body Schema * *

{@code
-     * {
-     *     data (Required): [
-     *          (Required){
-     *             embedding (Required): [
-     *                 double (Required)
-     *             ]
-     *             index: int (Required)
-     *         }
-     *     ]
-     *     usage (Required): {
-     *         prompt_tokens: int (Required)
-     *         total_tokens: int (Required)
-     *     }
-     * }
+     * String
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param 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. + * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 {@link Response}. + * @return transcribed text and associated metadata from provided spoken audio data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getEmbeddingsWithResponse( - String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { + public Response getAudioTranscriptionAsPlainTextWithResponse( + String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getEmbeddingsSync( + return service.getAudioTranscriptionAsPlainTextSync( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, accept, - embeddingsOptions, + audioTranscriptionOptions, requestOptions, Context.NONE); } /** - * 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. + * 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 * *

{@code
      * {
-     *     prompt (Required): [
-     *         String (Required)
-     *     ]
-     *     max_tokens: Integer (Optional)
+     *     file: byte[] (Required)
+     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
+     *     language: String (Optional)
+     *     prompt: String (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)
      * }
      * }
@@ -700,123 +656,71 @@ public Response getEmbeddingsWithResponse( * *
{@code
      * {
-     *     id: String (Required)
-     *     created: long (Required)
-     *     prompt_filter_results (Optional): [
-     *          (Optional){
-     *             prompt_index: int (Required)
-     *             content_filter_results (Optional): {
-     *                 sexual (Optional): {
-     *                     severity: String(safe/low/medium/high) (Required)
-     *                     filtered: boolean (Required)
-     *                 }
-     *                 violence (Optional): (recursive schema, see violence above)
-     *                 hate (Optional): (recursive schema, see hate above)
-     *                 self_harm (Optional): (recursive schema, see self_harm above)
-     *                 error (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                     target: String (Optional)
-     *                     details (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                     innererror (Optional): {
-     *                         code: String (Optional)
-     *                         innererror (Optional): (recursive schema, see innererror above)
-     *                     }
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     choices (Required): [
-     *          (Required){
+     *     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)
-     *             index: int (Required)
-     *             content_filter_results (Optional): (recursive schema, see content_filter_results above)
-     *             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(stop/length/content_filter/function_call) (Required)
+     *             temperature: double (Required)
+     *             avg_logprob: double (Required)
+     *             compression_ratio: double (Required)
+     *             no_speech_prob: double (Required)
+     *             tokens (Required): [
+     *                 int (Required)
+     *             ]
+     *             seek: int (Required)
      *         }
      *     ]
-     *     usage (Required): {
-     *         completion_tokens: int (Required)
-     *         prompt_tokens: int (Required)
-     *         total_tokens: int (Required)
-     *     }
      * }
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param 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. + * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 {@link Response} on successful completion - * of {@link Mono}. + * @return transcribed text and associated metadata from provided spoken audio data along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCompletionsWithResponseAsync( - String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + public Mono> getAudioTranscriptionAsResponseObjectWithResponseAsync( + String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getCompletions( + service.getAudioTranscriptionAsResponseObject( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, + contentType, accept, - completionsOptions, + audioTranscriptionOptions, requestOptions, context)); } /** - * 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. + * 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 * *

{@code
      * {
-     *     prompt (Required): [
-     *         String (Required)
-     *     ]
-     *     max_tokens: Integer (Optional)
+     *     file: byte[] (Required)
+     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
+     *     language: String (Optional)
+     *     prompt: String (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)
      * }
      * }
@@ -825,437 +729,161 @@ public Mono> getCompletionsWithResponseAsync( * *
{@code
      * {
-     *     id: String (Required)
-     *     created: long (Required)
-     *     prompt_filter_results (Optional): [
+     *     text: String (Required)
+     *     task: String(transcribe/translate) (Optional)
+     *     language: String (Optional)
+     *     duration: Double (Optional)
+     *     segments (Optional): [
      *          (Optional){
-     *             prompt_index: int (Required)
-     *             content_filter_results (Optional): {
-     *                 sexual (Optional): {
-     *                     severity: String(safe/low/medium/high) (Required)
-     *                     filtered: boolean (Required)
-     *                 }
-     *                 violence (Optional): (recursive schema, see violence above)
-     *                 hate (Optional): (recursive schema, see hate above)
-     *                 self_harm (Optional): (recursive schema, see self_harm above)
-     *                 error (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                     target: String (Optional)
-     *                     details (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                     innererror (Optional): {
-     *                         code: String (Optional)
-     *                         innererror (Optional): (recursive schema, see innererror above)
-     *                     }
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     choices (Required): [
-     *          (Required){
+     *             id: int (Required)
+     *             start: double (Required)
+     *             end: double (Required)
      *             text: String (Required)
-     *             index: int (Required)
-     *             content_filter_results (Optional): (recursive schema, see content_filter_results above)
-     *             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(stop/length/content_filter/function_call) (Required)
+     *             temperature: double (Required)
+     *             avg_logprob: double (Required)
+     *             compression_ratio: double (Required)
+     *             no_speech_prob: double (Required)
+     *             tokens (Required): [
+     *                 int (Required)
+     *             ]
+     *             seek: int (Required)
      *         }
      *     ]
-     *     usage (Required): {
-     *         completion_tokens: int (Required)
-     *         prompt_tokens: int (Required)
-     *         total_tokens: int (Required)
-     *     }
      * }
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param 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. + * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 {@link Response}. + * @return transcribed text and associated metadata from provided spoken audio data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCompletionsWithResponse( - String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + public Response getAudioTranscriptionAsResponseObjectWithResponse( + String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; - return service.getCompletionsSync( + return service.getAudioTranscriptionAsResponseObjectSync( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, + contentType, accept, - completionsOptions, + audioTranscriptionOptions, requestOptions, Context.NONE); } /** - * 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. + * Gets English language transcribed text and associated metadata from provided spoken audio data. * *

Request Body Schema * *

{@code
      * {
-     *     messages (Required): [
-     *          (Required){
-     *             role: String(system/assistant/user/function/tool) (Required)
-     *             content: String (Required)
-     *             name: String (Optional)
-     *             function_call (Optional): {
-     *                 name: String (Required)
-     *                 arguments: String (Required)
-     *             }
-     *             context (Optional): {
-     *                 messages (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *         }
-     *     ]
-     *     functions (Optional): [
-     *          (Optional){
-     *             name: String (Required)
-     *             description: String (Optional)
-     *             parameters: Object (Optional)
-     *         }
-     *     ]
-     *     function_call: FunctionCallModelBase (Optional)
-     *     max_tokens: Integer (Optional)
+     *     file: byte[] (Required)
+     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
+     *     prompt: String (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)
-     *     dataSources (Optional): [
-     *          (Optional){
-     *             type: String(AzureCognitiveSearch) (Required)
-     *             parameters: Object (Required)
-     *         }
-     *     ]
      * }
      * }
* *

Response Body Schema * *

{@code
-     * {
-     *     id: String (Required)
-     *     created: long (Required)
-     *     choices (Required): [
-     *          (Required){
-     *             message (Optional): {
-     *                 role: String(system/assistant/user/function/tool) (Required)
-     *                 content: String (Required)
-     *                 name: String (Optional)
-     *                 function_call (Optional): {
-     *                     name: String (Required)
-     *                     arguments: String (Required)
-     *                 }
-     *                 context (Optional): {
-     *                     messages (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                 }
-     *             }
-     *             index: int (Required)
-     *             finish_reason: String(stop/length/content_filter/function_call) (Required)
-     *             delta (Optional): (recursive schema, see delta above)
-     *             content_filter_results (Optional): {
-     *                 sexual (Optional): {
-     *                     severity: String(safe/low/medium/high) (Required)
-     *                     filtered: boolean (Required)
-     *                 }
-     *                 violence (Optional): (recursive schema, see violence above)
-     *                 hate (Optional): (recursive schema, see hate above)
-     *                 self_harm (Optional): (recursive schema, see self_harm above)
-     *                 error (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                     target: String (Optional)
-     *                     details (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                     innererror (Optional): {
-     *                         code: String (Optional)
-     *                         innererror (Optional): (recursive schema, see innererror above)
-     *                     }
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     prompt_filter_results (Optional): [
-     *          (Optional){
-     *             prompt_index: int (Required)
-     *             content_filter_results (Optional): (recursive schema, see content_filter_results above)
-     *         }
-     *     ]
-     *     usage (Required): {
-     *         completion_tokens: int (Required)
-     *         prompt_tokens: int (Required)
-     *         total_tokens: int (Required)
-     *     }
-     * }
+     * String
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param 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. + * @param audioTranslationOptions The configuration information for an audio translation request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 {@link Response} on successful - * completion of {@link Mono}. + * @return english language transcribed text and associated metadata from provided spoken audio data along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getChatCompletionsWithResponseAsync( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + public Mono> getAudioTranslationAsPlainTextWithResponseAsync( + String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getChatCompletions( + service.getAudioTranslationAsPlainText( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, accept, - chatCompletionsOptions, + audioTranslationOptions, requestOptions, context)); } /** - * 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. + * Gets English language transcribed text and associated metadata from provided spoken audio data. * *

Request Body Schema * *

{@code
      * {
-     *     messages (Required): [
-     *          (Required){
-     *             role: String(system/assistant/user/function/tool) (Required)
-     *             content: String (Required)
-     *             name: String (Optional)
-     *             function_call (Optional): {
-     *                 name: String (Required)
-     *                 arguments: String (Required)
-     *             }
-     *             context (Optional): {
-     *                 messages (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *         }
-     *     ]
-     *     functions (Optional): [
-     *          (Optional){
-     *             name: String (Required)
-     *             description: String (Optional)
-     *             parameters: Object (Optional)
-     *         }
-     *     ]
-     *     function_call: FunctionCallModelBase (Optional)
-     *     max_tokens: Integer (Optional)
+     *     file: byte[] (Required)
+     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
+     *     prompt: String (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)
-     *     dataSources (Optional): [
-     *          (Optional){
-     *             type: String(AzureCognitiveSearch) (Required)
-     *             parameters: Object (Required)
-     *         }
-     *     ]
      * }
      * }
* *

Response Body Schema * *

{@code
-     * {
-     *     id: String (Required)
-     *     created: long (Required)
-     *     choices (Required): [
-     *          (Required){
-     *             message (Optional): {
-     *                 role: String(system/assistant/user/function/tool) (Required)
-     *                 content: String (Required)
-     *                 name: String (Optional)
-     *                 function_call (Optional): {
-     *                     name: String (Required)
-     *                     arguments: String (Required)
-     *                 }
-     *                 context (Optional): {
-     *                     messages (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                 }
-     *             }
-     *             index: int (Required)
-     *             finish_reason: String(stop/length/content_filter/function_call) (Required)
-     *             delta (Optional): (recursive schema, see delta above)
-     *             content_filter_results (Optional): {
-     *                 sexual (Optional): {
-     *                     severity: String(safe/low/medium/high) (Required)
-     *                     filtered: boolean (Required)
-     *                 }
-     *                 violence (Optional): (recursive schema, see violence above)
-     *                 hate (Optional): (recursive schema, see hate above)
-     *                 self_harm (Optional): (recursive schema, see self_harm above)
-     *                 error (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                     target: String (Optional)
-     *                     details (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                     innererror (Optional): {
-     *                         code: String (Optional)
-     *                         innererror (Optional): (recursive schema, see innererror above)
-     *                     }
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     prompt_filter_results (Optional): [
-     *          (Optional){
-     *             prompt_index: int (Required)
-     *             content_filter_results (Optional): (recursive schema, see content_filter_results above)
-     *         }
-     *     ]
-     *     usage (Required): {
-     *         completion_tokens: int (Required)
-     *         prompt_tokens: int (Required)
-     *         total_tokens: int (Required)
-     *     }
-     * }
+     * String
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param 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. + * @param audioTranslationOptions The configuration information for an audio translation request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return 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 {@link Response}. + * @return english language transcribed text and associated metadata from provided spoken audio data along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getChatCompletionsWithResponse( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + public Response getAudioTranslationAsPlainTextWithResponse( + String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getChatCompletionsSync( + return service.getAudioTranslationAsPlainTextSync( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, accept, - chatCompletionsOptions, + audioTranslationOptions, requestOptions, Context.NONE); } /** - * Gets chat completions for the provided chat messages. This is an Azure-specific version of chat completions that - * supports integration with configured data sources and other augmentations to the base chat completions - * capabilities. + * Gets English language transcribed text and associated metadata from provided spoken audio data. * *

Request Body Schema * *

{@code
      * {
-     *     messages (Required): [
-     *          (Required){
-     *             role: String(system/assistant/user/function/tool) (Required)
-     *             content: String (Required)
-     *             name: String (Optional)
-     *             function_call (Optional): {
-     *                 name: String (Required)
-     *                 arguments: String (Required)
-     *             }
-     *             context (Optional): {
-     *                 messages (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *         }
-     *     ]
-     *     functions (Optional): [
-     *          (Optional){
-     *             name: String (Required)
-     *             description: String (Optional)
-     *             parameters: Object (Optional)
-     *         }
-     *     ]
-     *     function_call: FunctionCallModelBase (Optional)
-     *     max_tokens: Integer (Optional)
+     *     file: byte[] (Required)
+     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
+     *     prompt: String (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)
-     *     dataSources (Optional): [
-     *          (Optional){
-     *             type: String(AzureCognitiveSearch) (Required)
-     *             parameters: Object (Required)
-     *         }
-     *     ]
      * }
      * }
* @@ -1263,126 +891,138 @@ public Response getChatCompletionsWithResponse( * *
{@code
      * {
-     *     id: String (Required)
-     *     created: long (Required)
-     *     choices (Required): [
-     *          (Required){
-     *             message (Optional): {
-     *                 role: String(system/assistant/user/function/tool) (Required)
-     *                 content: String (Required)
-     *                 name: String (Optional)
-     *                 function_call (Optional): {
-     *                     name: String (Required)
-     *                     arguments: String (Required)
-     *                 }
-     *                 context (Optional): {
-     *                     messages (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                 }
-     *             }
-     *             index: int (Required)
-     *             finish_reason: String(stop/length/content_filter/function_call) (Required)
-     *             delta (Optional): (recursive schema, see delta above)
-     *             content_filter_results (Optional): {
-     *                 sexual (Optional): {
-     *                     severity: String(safe/low/medium/high) (Required)
-     *                     filtered: boolean (Required)
-     *                 }
-     *                 violence (Optional): (recursive schema, see violence above)
-     *                 hate (Optional): (recursive schema, see hate above)
-     *                 self_harm (Optional): (recursive schema, see self_harm above)
-     *                 error (Optional): {
-     *                     code: String (Required)
-     *                     message: String (Required)
-     *                     target: String (Optional)
-     *                     details (Optional): [
-     *                         (recursive schema, see above)
-     *                     ]
-     *                     innererror (Optional): {
-     *                         code: String (Optional)
-     *                         innererror (Optional): (recursive schema, see innererror above)
-     *                     }
-     *                 }
-     *             }
-     *         }
-     *     ]
-     *     prompt_filter_results (Optional): [
+     *     text: String (Required)
+     *     task: String(transcribe/translate) (Optional)
+     *     language: String (Optional)
+     *     duration: Double (Optional)
+     *     segments (Optional): [
      *          (Optional){
-     *             prompt_index: int (Required)
-     *             content_filter_results (Optional): (recursive schema, see content_filter_results above)
+     *             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)
      *         }
      *     ]
-     *     usage (Required): {
-     *         completion_tokens: int (Required)
-     *         prompt_tokens: int (Required)
-     *         total_tokens: int (Required)
-     *     }
      * }
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param 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. + * @param audioTranslationOptions The configuration information for an audio translation request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return chat completions for the provided chat messages. This is an Azure-specific version of chat completions - * that supports integration with configured data sources and other augmentations to the base chat completions - * capabilities along with {@link Response} on successful completion of {@link Mono}. + * @return english language transcribed text and associated metadata from provided spoken audio data along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getChatCompletionsWithAzureExtensionsWithResponseAsync( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + public Mono> getAudioTranslationAsResponseObjectWithResponseAsync( + String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getChatCompletionsWithAzureExtensions( + service.getAudioTranslationAsResponseObject( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, + contentType, accept, - chatCompletionsOptions, + audioTranslationOptions, requestOptions, context)); } /** - * Gets chat completions for the provided chat messages. This is an Azure-specific version of chat completions that - * supports integration with configured data sources and other augmentations to the base chat completions - * capabilities. + * Gets English language transcribed text and associated metadata from provided spoken audio data. * *

Request Body Schema * *

{@code
      * {
-     *     messages (Required): [
-     *          (Required){
-     *             role: String(system/assistant/user/function/tool) (Required)
-     *             content: String (Required)
-     *             name: String (Optional)
-     *             function_call (Optional): {
-     *                 name: String (Required)
-     *                 arguments: String (Required)
-     *             }
-     *             context (Optional): {
-     *                 messages (Optional): [
-     *                     (recursive schema, see above)
-     *                 ]
-     *             }
-     *         }
-     *     ]
-     *     functions (Optional): [
+     *     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 + * + *

{@code
+     * {
+     *     text: String (Required)
+     *     task: String(transcribe/translate) (Optional)
+     *     language: String (Optional)
+     *     duration: Double (Optional)
+     *     segments (Optional): [
      *          (Optional){
-     *             name: String (Required)
-     *             description: String (Optional)
-     *             parameters: Object (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)
      *         }
      *     ]
-     *     function_call: FunctionCallModelBase (Optional)
+     * }
+     * }
+ * + * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name + * (when using non-Azure OpenAI) to use for this request. + * @param audioTranslationOptions The configuration information for an audio translation request. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return english language transcribed text and associated metadata from provided spoken audio data along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAudioTranslationAsResponseObjectWithResponse( + String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.getAudioTranslationAsResponseObjectSync( + this.getEndpoint(), + this.getServiceVersion().getVersion(), + deploymentOrModelName, + contentType, + accept, + audioTranslationOptions, + requestOptions, + Context.NONE); + } + + /** + * 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 + * + *

{@code
+     * {
+     *     prompt (Required): [
+     *         String (Required)
+     *     ]
      *     max_tokens: Integer (Optional)
      *     temperature: Double (Optional)
      *     top_p: Double (Optional)
@@ -1391,19 +1031,16 @@ public Mono> getChatCompletionsWithAzureExtensionsWithRespo
      *     }
      *     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)
-     *     dataSources (Optional): [
-     *          (Optional){
-     *             type: String(AzureCognitiveSearch) (Required)
-     *             parameters: Object (Required)
-     *         }
-     *     ]
      * }
      * }
* @@ -1413,25 +1050,9 @@ public Mono> getChatCompletionsWithAzureExtensionsWithRespo * { * id: String (Required) * created: long (Required) - * choices (Required): [ - * (Required){ - * message (Optional): { - * role: String(system/assistant/user/function/tool) (Required) - * content: String (Required) - * name: String (Optional) - * function_call (Optional): { - * name: String (Required) - * arguments: String (Required) - * } - * context (Optional): { - * messages (Optional): [ - * (recursive schema, see above) - * ] - * } - * } - * index: int (Required) - * finish_reason: String(stop/length/content_filter/function_call) (Required) - * delta (Optional): (recursive schema, see delta above) + * prompt_filter_results (Optional): [ + * (Optional){ + * prompt_index: int (Required) * content_filter_results (Optional): { * sexual (Optional): { * severity: String(safe/low/medium/high) (Required) @@ -1455,10 +1076,28 @@ public Mono> getChatCompletionsWithAzureExtensionsWithRespo * } * } * ] - * prompt_filter_results (Optional): [ - * (Optional){ - * prompt_index: int (Required) + * choices (Required): [ + * (Required){ + * text: String (Required) + * index: int (Required) * content_filter_results (Optional): (recursive schema, see content_filter_results above) + * 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(stop/length/content_filter/function_call) (Required) * } * ] * usage (Required): { @@ -1471,109 +1110,62 @@ public Mono> getChatCompletionsWithAzureExtensionsWithRespo * * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param 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. + * @param 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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return chat completions for the provided chat messages. This is an Azure-specific version of chat completions - * that supports integration with configured data sources and other augmentations to the base chat completions - * capabilities along with {@link Response}. + * @return 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 {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getChatCompletionsWithAzureExtensionsWithResponse( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + public Mono> getCompletionsWithResponseAsync( + String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getChatCompletionsWithAzureExtensionsSync( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - chatCompletionsOptions, - requestOptions, - Context.NONE); + return FluxUtil.withContext( + context -> + service.getCompletions( + this.getEndpoint(), + this.getServiceVersion().getVersion(), + deploymentOrModelName, + accept, + completionsOptions, + requestOptions, + context)); } /** - * Starts the generation of a batch of images from a text caption. + * 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 * *

{@code
      * {
-     *     prompt: String (Required)
-     *     n: Integer (Optional)
-     *     size: String(256x256/512x512/1024x1024) (Optional)
-     *     response_format: String(url/b64_json) (Optional)
-     *     user: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * {
-     *     id: String (Required)
-     *     created: long (Required)
-     *     expires: Long (Optional)
-     *     result (Optional): {
-     *         created: long (Required)
-     *         data: DataModelBase (Required)
-     *     }
-     *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
-     *     error (Optional): {
-     *         code: String (Required)
-     *         message: String (Required)
-     *         target: String (Optional)
-     *         details (Optional): [
-     *             (recursive schema, see above)
-     *         ]
-     *         innererror (Optional): {
-     *             code: String (Optional)
-     *             innererror (Optional): (recursive schema, see innererror above)
-     *         }
+     *     prompt (Required): [
+     *         String (Required)
+     *     ]
+     *     max_tokens: Integer (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     logit_bias (Optional): {
+     *         String: int (Optional)
      *     }
-     * }
-     * }
- * - * @param imageGenerationOptions Represents the request data used to generate images. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a polling status update or final response payload for an image operation along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> beginAzureBatchImageGenerationWithResponseAsync( - BinaryData imageGenerationOptions, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.beginAzureBatchImageGeneration( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - imageGenerationOptions, - requestOptions, - context)); - } - - /** - * Starts the generation of a batch of images from a text caption. - * - *

Request Body Schema - * - *

{@code
-     * {
-     *     prompt: String (Required)
-     *     n: Integer (Optional)
-     *     size: String(256x256/512x512/1024x1024) (Optional)
-     *     response_format: String(url/b64_json) (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)
      * }
      * }
* @@ -1583,60 +1175,143 @@ private Mono> beginAzureBatchImageGenerationWithResponseAsy * { * id: String (Required) * created: long (Required) - * expires: Long (Optional) - * result (Optional): { - * created: long (Required) - * data: DataModelBase (Required) - * } - * status: String(notRunning/running/succeeded/canceled/failed) (Required) - * error (Optional): { - * code: String (Required) - * message: String (Required) - * target: String (Optional) - * details (Optional): [ - * (recursive schema, see above) - * ] - * innererror (Optional): { - * code: String (Optional) - * innererror (Optional): (recursive schema, see innererror above) + * prompt_filter_results (Optional): [ + * (Optional){ + * prompt_index: int (Required) + * content_filter_results (Optional): { + * sexual (Optional): { + * severity: String(safe/low/medium/high) (Required) + * filtered: boolean (Required) + * } + * violence (Optional): (recursive schema, see violence above) + * hate (Optional): (recursive schema, see hate above) + * self_harm (Optional): (recursive schema, see self_harm above) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * target: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * innererror (Optional): { + * code: String (Optional) + * innererror (Optional): (recursive schema, see innererror above) + * } + * } + * } + * } + * ] + * choices (Required): [ + * (Required){ + * text: String (Required) + * index: int (Required) + * content_filter_results (Optional): (recursive schema, see content_filter_results above) + * 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(stop/length/content_filter/function_call) (Required) * } + * ] + * usage (Required): { + * completion_tokens: int (Required) + * prompt_tokens: int (Required) + * total_tokens: int (Required) * } * } * } * - * @param imageGenerationOptions Represents the request data used to generate images. + * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name + * (when using non-Azure OpenAI) to use for this request. + * @param 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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a polling status update or final response payload for an image operation along with {@link Response}. + * @return 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 {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response beginAzureBatchImageGenerationWithResponse( - BinaryData imageGenerationOptions, RequestOptions requestOptions) { + public Response getCompletionsWithResponse( + String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.beginAzureBatchImageGenerationSync( + return service.getCompletionsSync( this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, - imageGenerationOptions, + completionsOptions, requestOptions, Context.NONE); } /** - * Starts the generation of a batch of images from a text caption. + * 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 * *

{@code
      * {
-     *     prompt: String (Required)
-     *     n: Integer (Optional)
-     *     size: String(256x256/512x512/1024x1024) (Optional)
-     *     response_format: String(url/b64_json) (Optional)
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/assistant/user/function/tool) (Required)
+     *             content: String (Required)
+     *             name: String (Optional)
+     *             function_call (Optional): {
+     *                 name: String (Required)
+     *                 arguments: String (Required)
+     *             }
+     *             context (Optional): {
+     *                 messages (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     functions (Optional): [
+     *          (Optional){
+     *             name: String (Required)
+     *             description: String (Optional)
+     *             parameters: Object (Optional)
+     *         }
+     *     ]
+     *     function_call: FunctionCallModelBase (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)
+     *     dataSources (Optional): [
+     *          (Optional){
+     *             type: String(AzureCognitiveSearch) (Required)
+     *             parameters: Object (Required)
+     *         }
+     *     ]
      * }
      * }
* @@ -1646,65 +1321,144 @@ private Response beginAzureBatchImageGenerationWithResponse( * { * id: String (Required) * created: long (Required) - * expires: Long (Optional) - * result (Optional): { - * created: long (Required) - * data: DataModelBase (Required) - * } - * status: String(notRunning/running/succeeded/canceled/failed) (Required) - * error (Optional): { - * code: String (Required) - * message: String (Required) - * target: String (Optional) - * details (Optional): [ - * (recursive schema, see above) - * ] - * innererror (Optional): { - * code: String (Optional) - * innererror (Optional): (recursive schema, see innererror above) + * choices (Required): [ + * (Required){ + * message (Optional): { + * role: String(system/assistant/user/function/tool) (Required) + * content: String (Required) + * name: String (Optional) + * function_call (Optional): { + * name: String (Required) + * arguments: String (Required) + * } + * context (Optional): { + * messages (Optional): [ + * (recursive schema, see above) + * ] + * } + * } + * index: int (Required) + * finish_reason: String(stop/length/content_filter/function_call) (Required) + * delta (Optional): (recursive schema, see delta above) + * content_filter_results (Optional): { + * sexual (Optional): { + * severity: String(safe/low/medium/high) (Required) + * filtered: boolean (Required) + * } + * violence (Optional): (recursive schema, see violence above) + * hate (Optional): (recursive schema, see hate above) + * self_harm (Optional): (recursive schema, see self_harm above) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * target: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * innererror (Optional): { + * code: String (Optional) + * innererror (Optional): (recursive schema, see innererror above) + * } + * } + * } * } + * ] + * prompt_filter_results (Optional): [ + * (Optional){ + * prompt_index: int (Required) + * content_filter_results (Optional): (recursive schema, see content_filter_results above) + * } + * ] + * usage (Required): { + * completion_tokens: int (Required) + * prompt_tokens: int (Required) + * total_tokens: int (Required) * } * } * } * - * @param imageGenerationOptions Represents the request data used to generate images. + * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name + * (when using non-Azure OpenAI) to use for this request. + * @param 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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link PollerFlux} for polling of a polling status update or final response payload for an image - * operation. + * @return 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 {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginBeginAzureBatchImageGenerationAsync( - BinaryData imageGenerationOptions, RequestOptions requestOptions) { - return PollerFlux.create( - Duration.ofSeconds(1), - () -> this.beginAzureBatchImageGenerationWithResponseAsync(imageGenerationOptions, requestOptions), - new DefaultPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) - .setEndpoint("{endpoint}/openai".replace("{endpoint}", this.getEndpoint())) - .setContext( - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE)), - TypeReference.createInstance(BinaryData.class), - TypeReference.createInstance(BinaryData.class)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getChatCompletionsWithResponseAsync( + String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext( + context -> + service.getChatCompletions( + this.getEndpoint(), + this.getServiceVersion().getVersion(), + deploymentOrModelName, + accept, + chatCompletionsOptions, + requestOptions, + context)); } /** - * Starts the generation of a batch of images from a text caption. + * 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 * *

{@code
      * {
-     *     prompt: String (Required)
-     *     n: Integer (Optional)
-     *     size: String(256x256/512x512/1024x1024) (Optional)
-     *     response_format: String(url/b64_json) (Optional)
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/assistant/user/function/tool) (Required)
+     *             content: String (Required)
+     *             name: String (Optional)
+     *             function_call (Optional): {
+     *                 name: String (Required)
+     *                 arguments: String (Required)
+     *             }
+     *             context (Optional): {
+     *                 messages (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     functions (Optional): [
+     *          (Optional){
+     *             name: String (Required)
+     *             description: String (Optional)
+     *             parameters: Object (Optional)
+     *         }
+     *     ]
+     *     function_call: FunctionCallModelBase (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)
+     *     dataSources (Optional): [
+     *          (Optional){
+     *             type: String(AzureCognitiveSearch) (Required)
+     *             parameters: Object (Required)
+     *         }
+     *     ]
      * }
      * }
* @@ -1714,164 +1468,394 @@ public PollerFlux beginBeginAzureBatchImageGenerationAsy * { * id: String (Required) * created: long (Required) - * expires: Long (Optional) - * result (Optional): { - * created: long (Required) - * data: DataModelBase (Required) - * } - * status: String(notRunning/running/succeeded/canceled/failed) (Required) - * error (Optional): { - * code: String (Required) - * message: String (Required) - * target: String (Optional) - * details (Optional): [ - * (recursive schema, see above) - * ] - * innererror (Optional): { - * code: String (Optional) - * innererror (Optional): (recursive schema, see innererror above) + * choices (Required): [ + * (Required){ + * message (Optional): { + * role: String(system/assistant/user/function/tool) (Required) + * content: String (Required) + * name: String (Optional) + * function_call (Optional): { + * name: String (Required) + * arguments: String (Required) + * } + * context (Optional): { + * messages (Optional): [ + * (recursive schema, see above) + * ] + * } + * } + * index: int (Required) + * finish_reason: String(stop/length/content_filter/function_call) (Required) + * delta (Optional): (recursive schema, see delta above) + * content_filter_results (Optional): { + * sexual (Optional): { + * severity: String(safe/low/medium/high) (Required) + * filtered: boolean (Required) + * } + * violence (Optional): (recursive schema, see violence above) + * hate (Optional): (recursive schema, see hate above) + * self_harm (Optional): (recursive schema, see self_harm above) + * error (Optional): { + * code: String (Required) + * message: String (Required) + * target: String (Optional) + * details (Optional): [ + * (recursive schema, see above) + * ] + * innererror (Optional): { + * code: String (Optional) + * innererror (Optional): (recursive schema, see innererror above) + * } + * } + * } * } + * ] + * prompt_filter_results (Optional): [ + * (Optional){ + * prompt_index: int (Required) + * content_filter_results (Optional): (recursive schema, see content_filter_results above) + * } + * ] + * usage (Required): { + * completion_tokens: int (Required) + * prompt_tokens: int (Required) + * total_tokens: int (Required) * } * } * } * - * @param imageGenerationOptions Represents the request data used to generate images. + * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name + * (when using non-Azure OpenAI) to use for this request. + * @param 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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the {@link SyncPoller} for polling of a polling status update or final response payload for an image - * operation. + * @return 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 {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller beginBeginAzureBatchImageGeneration( - BinaryData imageGenerationOptions, RequestOptions requestOptions) { - return SyncPoller.createPoller( - Duration.ofSeconds(1), - () -> this.beginAzureBatchImageGenerationWithResponse(imageGenerationOptions, requestOptions), - new SyncDefaultPollingStrategy<>( - new PollingStrategyOptions(this.getHttpPipeline()) - .setEndpoint("{endpoint}/openai".replace("{endpoint}", this.getEndpoint())) - .setContext( - requestOptions != null && requestOptions.getContext() != null - ? requestOptions.getContext() - : Context.NONE)), - TypeReference.createInstance(BinaryData.class), - TypeReference.createInstance(BinaryData.class)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getChatCompletionsWithResponse( + String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getChatCompletionsSync( + this.getEndpoint(), + this.getServiceVersion().getVersion(), + deploymentOrModelName, + accept, + chatCompletionsOptions, + requestOptions, + Context.NONE); } /** - * 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. + * Gets chat completions for the provided chat messages. This is an Azure-specific version of chat completions that + * supports integration with configured data sources and other augmentations to the base chat completions + * capabilities. * *

Request Body Schema * *

{@code
      * {
-     *     file: byte[] (Required)
-     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
-     *     language: String (Optional)
-     *     prompt: String (Optional)
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/assistant/user/function/tool) (Required)
+     *             content: String (Required)
+     *             name: String (Optional)
+     *             function_call (Optional): {
+     *                 name: String (Required)
+     *                 arguments: String (Required)
+     *             }
+     *             context (Optional): {
+     *                 messages (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     functions (Optional): [
+     *          (Optional){
+     *             name: String (Required)
+     *             description: String (Optional)
+     *             parameters: Object (Optional)
+     *         }
+     *     ]
+     *     function_call: FunctionCallModelBase (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)
+     *     dataSources (Optional): [
+     *          (Optional){
+     *             type: String(AzureCognitiveSearch) (Required)
+     *             parameters: Object (Required)
+     *         }
+     *     ]
      * }
      * }
* *

Response Body Schema * *

{@code
-     * String
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     choices (Required): [
+     *          (Required){
+     *             message (Optional): {
+     *                 role: String(system/assistant/user/function/tool) (Required)
+     *                 content: String (Required)
+     *                 name: String (Optional)
+     *                 function_call (Optional): {
+     *                     name: String (Required)
+     *                     arguments: String (Required)
+     *                 }
+     *                 context (Optional): {
+     *                     messages (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *             }
+     *             index: int (Required)
+     *             finish_reason: String(stop/length/content_filter/function_call) (Required)
+     *             delta (Optional): (recursive schema, see delta above)
+     *             content_filter_results (Optional): {
+     *                 sexual (Optional): {
+     *                     severity: String(safe/low/medium/high) (Required)
+     *                     filtered: boolean (Required)
+     *                 }
+     *                 violence (Optional): (recursive schema, see violence above)
+     *                 hate (Optional): (recursive schema, see hate above)
+     *                 self_harm (Optional): (recursive schema, see self_harm above)
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     target: String (Optional)
+     *                     details (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     innererror (Optional): {
+     *                         code: String (Optional)
+     *                         innererror (Optional): (recursive schema, see innererror above)
+     *                     }
+     *                 }
+     *             }
+     *         }
+     *     ]
+     *     prompt_filter_results (Optional): [
+     *          (Optional){
+     *             prompt_index: int (Required)
+     *             content_filter_results (Optional): (recursive schema, see content_filter_results above)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         completion_tokens: int (Required)
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     * }
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param audioTranscriptionOptions The configuration information for an audio transcription request. + * @param 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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return transcribed text and associated metadata from provided spoken audio data along with {@link Response} on - * successful completion of {@link Mono}. + * @return chat completions for the provided chat messages. This is an Azure-specific version of chat completions + * that supports integration with configured data sources and other augmentations to the base chat completions + * capabilities along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranscriptionAsPlainTextWithResponseAsync( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + public Mono> getChatCompletionsWithAzureExtensionsWithResponseAsync( + String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getAudioTranscriptionAsPlainText( + service.getChatCompletionsWithAzureExtensions( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, accept, - audioTranscriptionOptions, + chatCompletionsOptions, requestOptions, context)); } /** - * 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. + * Gets chat completions for the provided chat messages. This is an Azure-specific version of chat completions that + * supports integration with configured data sources and other augmentations to the base chat completions + * capabilities. * *

Request Body Schema * *

{@code
      * {
-     *     file: byte[] (Required)
-     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
-     *     language: String (Optional)
-     *     prompt: String (Optional)
+     *     messages (Required): [
+     *          (Required){
+     *             role: String(system/assistant/user/function/tool) (Required)
+     *             content: String (Required)
+     *             name: String (Optional)
+     *             function_call (Optional): {
+     *                 name: String (Required)
+     *                 arguments: String (Required)
+     *             }
+     *             context (Optional): {
+     *                 messages (Optional): [
+     *                     (recursive schema, see above)
+     *                 ]
+     *             }
+     *         }
+     *     ]
+     *     functions (Optional): [
+     *          (Optional){
+     *             name: String (Required)
+     *             description: String (Optional)
+     *             parameters: Object (Optional)
+     *         }
+     *     ]
+     *     function_call: FunctionCallModelBase (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)
+     *     dataSources (Optional): [
+     *          (Optional){
+     *             type: String(AzureCognitiveSearch) (Required)
+     *             parameters: Object (Required)
+     *         }
+     *     ]
      * }
      * }
* *

Response Body Schema * *

{@code
-     * String
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     choices (Required): [
+     *          (Required){
+     *             message (Optional): {
+     *                 role: String(system/assistant/user/function/tool) (Required)
+     *                 content: String (Required)
+     *                 name: String (Optional)
+     *                 function_call (Optional): {
+     *                     name: String (Required)
+     *                     arguments: String (Required)
+     *                 }
+     *                 context (Optional): {
+     *                     messages (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                 }
+     *             }
+     *             index: int (Required)
+     *             finish_reason: String(stop/length/content_filter/function_call) (Required)
+     *             delta (Optional): (recursive schema, see delta above)
+     *             content_filter_results (Optional): {
+     *                 sexual (Optional): {
+     *                     severity: String(safe/low/medium/high) (Required)
+     *                     filtered: boolean (Required)
+     *                 }
+     *                 violence (Optional): (recursive schema, see violence above)
+     *                 hate (Optional): (recursive schema, see hate above)
+     *                 self_harm (Optional): (recursive schema, see self_harm above)
+     *                 error (Optional): {
+     *                     code: String (Required)
+     *                     message: String (Required)
+     *                     target: String (Optional)
+     *                     details (Optional): [
+     *                         (recursive schema, see above)
+     *                     ]
+     *                     innererror (Optional): {
+     *                         code: String (Optional)
+     *                         innererror (Optional): (recursive schema, see innererror above)
+     *                     }
+     *                 }
+     *             }
+     *         }
+     *     ]
+     *     prompt_filter_results (Optional): [
+     *          (Optional){
+     *             prompt_index: int (Required)
+     *             content_filter_results (Optional): (recursive schema, see content_filter_results above)
+     *         }
+     *     ]
+     *     usage (Required): {
+     *         completion_tokens: int (Required)
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
+     * }
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param audioTranscriptionOptions The configuration information for an audio transcription request. + * @param 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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return transcribed text and associated metadata from provided spoken audio data along with {@link Response}. + * @return chat completions for the provided chat messages. This is an Azure-specific version of chat completions + * that supports integration with configured data sources and other augmentations to the base chat completions + * capabilities along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranscriptionAsPlainTextWithResponse( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + public Response getChatCompletionsWithAzureExtensionsWithResponse( + String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAudioTranscriptionAsPlainTextSync( + return service.getChatCompletionsWithAzureExtensionsSync( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, accept, - audioTranscriptionOptions, + chatCompletionsOptions, requestOptions, Context.NONE); } /** - * 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. + * Starts the generation of a batch of images from a text caption. * *

Request Body Schema * *

{@code
      * {
-     *     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)
+     *     prompt: String (Required)
+     *     n: Integer (Optional)
+     *     size: String(256x256/512x512/1024x1024) (Optional)
+     *     response_format: String(url/b64_json) (Optional)
+     *     user: String (Optional)
      * }
      * }
* @@ -1879,72 +1863,65 @@ public Response getAudioTranscriptionAsPlainTextWithResponse( * *
{@code
      * {
-     *     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)
+     *     id: String (Required)
+     *     created: long (Required)
+     *     expires: Long (Optional)
+     *     result (Optional): {
+     *         created: long (Required)
+     *         data: DataModelBase (Required)
+     *     }
+     *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
      *         }
-     *     ]
+     *     }
      * }
      * }
* - * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name - * (when using non-Azure OpenAI) to use for this request. - * @param audioTranscriptionOptions The configuration information for an audio transcription request. + * @param imageGenerationOptions Represents the request data used to generate images. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return transcribed text and associated metadata from provided spoken audio data along with {@link Response} on + * @return a polling status update or final response payload for an image operation along with {@link Response} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranscriptionAsResponseObjectWithResponseAsync( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; + private Mono> beginAzureBatchImageGenerationWithResponseAsync( + BinaryData imageGenerationOptions, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getAudioTranscriptionAsResponseObject( + service.beginAzureBatchImageGeneration( this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, - contentType, accept, - audioTranscriptionOptions, + imageGenerationOptions, requestOptions, context)); } /** - * 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. + * Starts the generation of a batch of images from a text caption. * *

Request Body Schema * *

{@code
      * {
-     *     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)
+     *     prompt: String (Required)
+     *     n: Integer (Optional)
+     *     size: String(256x256/512x512/1024x1024) (Optional)
+     *     response_format: String(url/b64_json) (Optional)
+     *     user: String (Optional)
      * }
      * }
* @@ -1952,161 +1929,198 @@ public Mono> getAudioTranscriptionAsResponseObjectWithRespo * *
{@code
      * {
-     *     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)
+     *     id: String (Required)
+     *     created: long (Required)
+     *     expires: Long (Optional)
+     *     result (Optional): {
+     *         created: long (Required)
+     *         data: DataModelBase (Required)
+     *     }
+     *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
      *         }
-     *     ]
+     *     }
      * }
      * }
* - * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name - * (when using non-Azure OpenAI) to use for this request. - * @param audioTranscriptionOptions The configuration information for an audio transcription request. + * @param imageGenerationOptions Represents the request data used to generate images. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return transcribed text and associated metadata from provided spoken audio data along with {@link Response}. + * @return a polling status update or final response payload for an image operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranscriptionAsResponseObjectWithResponse( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; + private Response beginAzureBatchImageGenerationWithResponse( + BinaryData imageGenerationOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAudioTranscriptionAsResponseObjectSync( + return service.beginAzureBatchImageGenerationSync( this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, - contentType, accept, - audioTranscriptionOptions, + imageGenerationOptions, requestOptions, Context.NONE); } /** - * Gets English language transcribed text and associated metadata from provided spoken audio data. + * Starts the generation of a batch of images from a text caption. * *

Request Body Schema * *

{@code
      * {
-     *     file: byte[] (Required)
-     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
-     *     prompt: String (Optional)
-     *     temperature: Double (Optional)
-     *     model: String (Optional)
+     *     prompt: String (Required)
+     *     n: Integer (Optional)
+     *     size: String(256x256/512x512/1024x1024) (Optional)
+     *     response_format: String(url/b64_json) (Optional)
+     *     user: String (Optional)
      * }
      * }
* *

Response Body Schema * *

{@code
-     * String
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     expires: Long (Optional)
+     *     result (Optional): {
+     *         created: long (Required)
+     *         data: DataModelBase (Required)
+     *     }
+     *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
      * }
* - * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name - * (when using non-Azure OpenAI) to use for this request. - * @param audioTranslationOptions The configuration information for an audio translation request. + * @param imageGenerationOptions Represents the request data used to generate images. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return english language transcribed text and associated metadata from provided spoken audio data along with - * {@link Response} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of a polling status update or final response payload for an image + * operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranslationAsPlainTextWithResponseAsync( - String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getAudioTranslationAsPlainText( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - audioTranslationOptions, - requestOptions, - context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginBeginAzureBatchImageGenerationAsync( + BinaryData imageGenerationOptions, RequestOptions requestOptions) { + return PollerFlux.create( + Duration.ofSeconds(1), + () -> this.beginAzureBatchImageGenerationWithResponseAsync(imageGenerationOptions, requestOptions), + new DefaultPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/openai".replace("{endpoint}", this.getEndpoint())) + .setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE)), + TypeReference.createInstance(BinaryData.class), + TypeReference.createInstance(BinaryData.class)); } /** - * Gets English language transcribed text and associated metadata from provided spoken audio data. + * Starts the generation of a batch of images from a text caption. * *

Request Body Schema * *

{@code
      * {
-     *     file: byte[] (Required)
-     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
-     *     prompt: String (Optional)
-     *     temperature: Double (Optional)
-     *     model: String (Optional)
+     *     prompt: String (Required)
+     *     n: Integer (Optional)
+     *     size: String(256x256/512x512/1024x1024) (Optional)
+     *     response_format: String(url/b64_json) (Optional)
+     *     user: String (Optional)
      * }
      * }
* *

Response Body Schema * *

{@code
-     * String
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     expires: Long (Optional)
+     *     result (Optional): {
+     *         created: long (Required)
+     *         data: DataModelBase (Required)
+     *     }
+     *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
      * }
* - * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name - * (when using non-Azure OpenAI) to use for this request. - * @param audioTranslationOptions The configuration information for an audio translation request. + * @param imageGenerationOptions Represents the request data used to generate images. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return english language transcribed text and associated metadata from provided spoken audio data along with - * {@link Response}. + * @return the {@link SyncPoller} for polling of a polling status update or final response payload for an image + * operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranslationAsPlainTextWithResponse( - String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getAudioTranslationAsPlainTextSync( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - audioTranslationOptions, - requestOptions, - Context.NONE); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginBeginAzureBatchImageGeneration( + BinaryData imageGenerationOptions, RequestOptions requestOptions) { + return SyncPoller.createPoller( + Duration.ofSeconds(1), + () -> this.beginAzureBatchImageGenerationWithResponse(imageGenerationOptions, requestOptions), + new SyncDefaultPollingStrategy<>( + new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}/openai".replace("{endpoint}", this.getEndpoint())) + .setContext( + requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE)), + TypeReference.createInstance(BinaryData.class), + TypeReference.createInstance(BinaryData.class)); } /** - * Gets English language transcribed text and associated metadata from provided spoken audio data. + * Return the embeddings for a given prompt. * *

Request Body Schema * *

{@code
      * {
-     *     file: byte[] (Required)
-     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
-     *     prompt: String (Optional)
-     *     temperature: Double (Optional)
+     *     user: String (Optional)
      *     model: String (Optional)
+     *     input (Required): [
+     *         String (Required)
+     *     ]
      * }
      * }
* @@ -2114,70 +2128,63 @@ public Response getAudioTranslationAsPlainTextWithResponse( * *
{@code
      * {
-     *     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)
+     *     data (Required): [
+     *          (Required){
+     *             embedding (Required): [
+     *                 double (Required)
      *             ]
-     *             seek: int (Required)
+     *             index: int (Required)
      *         }
      *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
      * }
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param audioTranslationOptions The configuration information for an audio translation request. + * @param 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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return english language transcribed text and associated metadata from provided spoken audio data along with - * {@link Response} on successful completion of {@link Mono}. + * @return 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 {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranslationAsResponseObjectWithResponseAsync( - String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; + public Mono> getEmbeddingsWithResponseAsync( + String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil.withContext( context -> - service.getAudioTranslationAsResponseObject( + service.getEmbeddings( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, - contentType, accept, - audioTranslationOptions, + embeddingsOptions, requestOptions, context)); } /** - * Gets English language transcribed text and associated metadata from provided spoken audio data. + * Return the embeddings for a given prompt. * *

Request Body Schema * *

{@code
      * {
-     *     file: byte[] (Required)
-     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
-     *     prompt: String (Optional)
-     *     temperature: Double (Optional)
+     *     user: String (Optional)
      *     model: String (Optional)
+     *     input (Required): [
+     *         String (Required)
+     *     ]
      * }
      * }
* @@ -2185,52 +2192,45 @@ public Mono> getAudioTranslationAsResponseObjectWithRespons * *
{@code
      * {
-     *     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)
+     *     data (Required): [
+     *          (Required){
+     *             embedding (Required): [
+     *                 double (Required)
      *             ]
-     *             seek: int (Required)
+     *             index: int (Required)
      *         }
      *     ]
+     *     usage (Required): {
+     *         prompt_tokens: int (Required)
+     *         total_tokens: int (Required)
+     *     }
      * }
      * }
* * @param deploymentOrModelName Specifies either the model deployment name (when using Azure OpenAI) or model name * (when using non-Azure OpenAI) to use for this request. - * @param audioTranslationOptions The configuration information for an audio translation request. + * @param 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. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return english language transcribed text and associated metadata from provided spoken audio data along with - * {@link Response}. + * @return 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 {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranslationAsResponseObjectWithResponse( - String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; + public Response getEmbeddingsWithResponse( + String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getAudioTranslationAsResponseObjectSync( + return service.getEmbeddingsSync( this.getEndpoint(), this.getServiceVersion().getVersion(), deploymentOrModelName, - contentType, accept, - audioTranslationOptions, + embeddingsOptions, requestOptions, Context.NONE); } diff --git a/sdk/openai/azure-ai-openai/tsp-location.yaml b/sdk/openai/azure-ai-openai/tsp-location.yaml index 9dbc49d97eac..e5b6bd44ba88 100644 --- a/sdk/openai/azure-ai-openai/tsp-location.yaml +++ b/sdk/openai/azure-ai-openai/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/cognitiveservices/OpenAI.Inference -additionalDirectories: - - specification/cognitiveservices/OpenAI.Authoring -commit: 90247ef2960fbe11e8639c796f9bf1d2c90bb79f +additionalDirectories: [] +commit: 13e2f093a757b309926abeb467510ad302d2614d repo: Azure/azure-rest-api-specs +