diff --git a/sdk/openai/azure-ai-openai/CHANGELOG.md b/sdk/openai/azure-ai-openai/CHANGELOG.md index 07ad155c9b4e..19df0085d600 100644 --- a/sdk/openai/azure-ai-openai/CHANGELOG.md +++ b/sdk/openai/azure-ai-openai/CHANGELOG.md @@ -10,6 +10,7 @@ Use `getAudioTranscription` or `getAudioTranscriptionWithResponse` convenience methods from respective classes. - Removed methods `getAudioTranslationAsResponseObject` and `getAudioTranslationAsResponseObjectWithResponse` from `OpenAIClient` and `OpenAIAsyncClient` classes. Use `getAudioTranslation` or `getAudioTranslationWithResponse` convenience methods from respective classes. +- Removed property, ResponseError `error` from `ImageLocation` class. ### Bugs Fixed diff --git a/sdk/openai/azure-ai-openai/README.md b/sdk/openai/azure-ai-openai/README.md index 24086b5e4388..e010030dcb4f 100644 --- a/sdk/openai/azure-ai-openai/README.md +++ b/sdk/openai/azure-ai-openai/README.md @@ -276,15 +276,9 @@ ImageGenerationOptions imageGenerationOptions = new ImageGenerationOptions( ImageResponse images = client.getImages(imageGenerationOptions); for (ImageLocation imageLocation : images.getData()) { - ResponseError error = imageLocation.getError(); - if (error != null) { - System.out.printf("Image generation operation failed. Error code: %s, error message: %s.%n", - error.getCode(), error.getMessage()); - } else { - System.out.printf( - "Image location URL that provides temporary access to download the generated image is %s.%n", - imageLocation.getUrl()); - } + System.out.printf( + "Image location URL that provides temporary access to download the generated image is %s.%n", + imageLocation.getUrl()); } ``` diff --git a/sdk/openai/azure-ai-openai/assets.json b/sdk/openai/azure-ai-openai/assets.json index b76c9230a724..606a9d079573 100644 --- a/sdk/openai/azure-ai-openai/assets.json +++ b/sdk/openai/azure-ai-openai/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/openai/azure-ai-openai", - "Tag": "java/openai/azure-ai-openai_a191d5c4de" + "Tag": "java/openai/azure-ai-openai_d62b613ecd" } 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 9bdc7d60d521..c8321f661ccd 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,66 +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) - .setServiceVersion(this.getServiceVersion().getVersion())), - 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)
+     *         }
+     *     ]
      * }
      * }
* @@ -1715,165 +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) - .setServiceVersion(this.getServiceVersion().getVersion())), - 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)
      * }
      * }
* @@ -1881,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)
      * }
      * }
* @@ -1954,161 +1929,200 @@ 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) + .setServiceVersion(this.getServiceVersion().getVersion())), + 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) + .setServiceVersion(this.getServiceVersion().getVersion())), + 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)
+     *     ]
      * }
      * }
* @@ -2116,70 +2130,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)
+     *     ]
      * }
      * }
* @@ -2187,52 +2194,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/src/main/java/com/azure/ai/openai/implementation/models/BatchImageGenerationOperationResponse.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/BatchImageGenerationOperationResponse.java new file mode 100644 index 000000000000..4b7dc8870200 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/BatchImageGenerationOperationResponse.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.implementation.models; + +import com.azure.ai.openai.models.AzureOpenAIOperationState; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.models.ResponseError; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** A polling status update or final response payload for an image operation. */ +@Immutable +public final class BatchImageGenerationOperationResponse { + + /* + * The ID of the operation. + */ + @Generated + @JsonProperty(value = "id") + private String id; + + /* + * A timestamp when this job or item was created (in unix epochs). + */ + @Generated + @JsonProperty(value = "created") + private long createdAt; + + /* + * A timestamp when this operation and its associated images expire and will be deleted (in unix epochs). + */ + @Generated + @JsonProperty(value = "expires") + private Long expires; + + /* + * The result of the operation if the operation succeeded. + */ + @Generated + @JsonProperty(value = "result") + private ImageGenerations result; + + /* + * The status of the operation + */ + @Generated + @JsonProperty(value = "status") + private AzureOpenAIOperationState status; + + /* + * The error if the operation failed. + */ + @Generated + @JsonProperty(value = "error") + private ResponseError error; + + /** + * Creates an instance of BatchImageGenerationOperationResponse class. + * + * @param id the id value to set. + * @param createdAt the createdAt value to set. + * @param status the status value to set. + */ + @Generated + private BatchImageGenerationOperationResponse( + String id, OffsetDateTime createdAt, AzureOpenAIOperationState status) { + this.id = id; + this.createdAt = createdAt.toEpochSecond(); + this.status = status; + } + + @Generated + @JsonCreator + private BatchImageGenerationOperationResponse( + @JsonProperty(value = "id") String id, + @JsonProperty(value = "created") long createdAt, + @JsonProperty(value = "status") AzureOpenAIOperationState status) { + this(id, OffsetDateTime.ofInstant(Instant.ofEpochSecond(createdAt), ZoneOffset.UTC), status); + } + + /** + * Get the id property: The ID of the operation. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the createdAt property: A timestamp when this job or item was created (in unix epochs). + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the expires property: A timestamp when this operation and its associated images expire and will be deleted + * (in unix epochs). + * + * @return the expires value. + */ + @Generated + public Long getExpires() { + return this.expires; + } + + /** + * Get the result property: The result of the operation if the operation succeeded. + * + * @return the result value. + */ + @Generated + public ImageGenerations getResult() { + return this.result; + } + + /** + * Get the status property: The status of the operation. + * + * @return the status value. + */ + @Generated + public AzureOpenAIOperationState getStatus() { + return this.status; + } + + /** + * Get the error property: The error if the operation failed. + * + * @return the error value. + */ + @Generated + public ResponseError getError() { + return this.error; + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ChatCompletionsOptions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ChatCompletionsOptions.java new file mode 100644 index 000000000000..c1c382da7c3c --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ChatCompletionsOptions.java @@ -0,0 +1,534 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.implementation.models; + +import com.azure.ai.openai.models.AzureChatExtensionConfiguration; +import com.azure.ai.openai.models.ChatMessage; +import com.azure.ai.openai.models.FunctionDefinition; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** + * 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. + */ +@Fluent +public final class ChatCompletionsOptions { + + /* + * The collection of context messages associated with this chat completions request. + * Typical usage begins with a chat message for the System role that provides instructions for + * the behavior of the assistant, followed by alternating messages between the User and + * Assistant roles. + */ + @Generated + @JsonProperty(value = "messages") + private List messages; + + /* + * A list of functions the model may generate JSON inputs for. + */ + @Generated + @JsonProperty(value = "functions") + private List functions; + + /* + * Controls how the model responds to function calls. "none" means the model does not call a function, + * and responds to the end-user. "auto" means the model can pick between an end-user or calling a function. + * Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + * "none" is the default when no functions are present. "auto" is the default if functions are present. + */ + @Generated + @JsonProperty(value = "function_call") + private FunctionCallModelBase functionCall; + + /* + * The maximum number of tokens to generate. + */ + @Generated + @JsonProperty(value = "max_tokens") + private Integer maxTokens; + + /* + * The sampling temperature to use that controls the apparent creativity of generated completions. + * Higher values will make output more random while lower values will make results more focused + * and deterministic. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + */ + @Generated + @JsonProperty(value = "temperature") + private Double temperature; + + /* + * An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a + * value of 0.15 will cause only the tokens comprising the top 15% of probability mass to be + * considered. + * It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + */ + @Generated + @JsonProperty(value = "top_p") + private Double topP; + + /* + * A map between GPT token IDs and bias scores that influences the probability of specific tokens + * appearing in a completions response. Token IDs are computed via external tokenizer tools, while + * bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to + * a full ban or exclusive selection of a token, respectively. The exact behavior of a given bias + * score varies by model. + */ + @Generated + @JsonProperty(value = "logit_bias") + private Map logitBias; + + /* + * An identifier for the caller or end user of the operation. This may be used for tracking + * or rate-limiting purposes. + */ + @Generated + @JsonProperty(value = "user") + private String user; + + /* + * The number of chat completions choices that should be generated for a chat completions + * response. + * Because this setting can generate many completions, it may quickly consume your token quota. + * Use carefully and ensure reasonable settings for max_tokens and stop. + */ + @Generated + @JsonProperty(value = "n") + private Integer n; + + /* + * A collection of textual sequences that will end completions generation. + */ + @Generated + @JsonProperty(value = "stop") + private List stop; + + /* + * A value that influences the probability of generated tokens appearing based on their existing + * presence in generated text. + * Positive values will make tokens less likely to appear when they already exist and increase the + * model's likelihood to output new topics. + */ + @Generated + @JsonProperty(value = "presence_penalty") + private Double presencePenalty; + + /* + * A value that influences the probability of generated tokens appearing based on their cumulative + * frequency in generated text. + * Positive values will make tokens less likely to appear as their frequency increases and + * decrease the likelihood of the model repeating the same statements verbatim. + */ + @Generated + @JsonProperty(value = "frequency_penalty") + private Double frequencyPenalty; + + /* + * A value indicating whether chat completions should be streamed for this request. + */ + @Generated + @JsonProperty(value = "stream") + private Boolean stream; + + /* + * The model name to provide as part of this completions request. + * Not applicable to Azure OpenAI, where deployment information should be included in the Azure + * resource URI that's connected to. + */ + @Generated + @JsonProperty(value = "model") + private String model; + + /* + * The configuration entries for Azure OpenAI chat extensions that use them. + * This additional specification is only compatible with Azure OpenAI. + */ + @Generated + @JsonProperty(value = "dataSources") + private List dataSources; + + /** + * Creates an instance of ChatCompletionsOptions class. + * + * @param messages the messages value to set. + */ + @Generated + @JsonCreator + public ChatCompletionsOptions(@JsonProperty(value = "messages") List messages) { + this.messages = messages; + } + + /** + * Get the messages property: The collection of context messages associated with this chat completions request. + * Typical usage begins with a chat message for the System role that provides instructions for the behavior of the + * assistant, followed by alternating messages between the User and Assistant roles. + * + * @return the messages value. + */ + @Generated + public List getMessages() { + return this.messages; + } + + /** + * Get the functions property: A list of functions the model may generate JSON inputs for. + * + * @return the functions value. + */ + @Generated + public List getFunctions() { + return this.functions; + } + + /** + * Set the functions property: A list of functions the model may generate JSON inputs for. + * + * @param functions the functions value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setFunctions(List functions) { + this.functions = functions; + return this; + } + + /** + * Get the functionCall property: Controls how the model responds to function calls. "none" means the model does not + * call a function, and responds to the end-user. "auto" means the model can pick between an end-user or calling a + * function. Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + * "none" is the default when no functions are present. "auto" is the default if functions are present. + * + * @return the functionCall value. + */ + @Generated + public FunctionCallModelBase getFunctionCall() { + return this.functionCall; + } + + /** + * Set the functionCall property: Controls how the model responds to function calls. "none" means the model does not + * call a function, and responds to the end-user. "auto" means the model can pick between an end-user or calling a + * function. Specifying a particular function via `{"name": "my_function"}` forces the model to call that function. + * "none" is the default when no functions are present. "auto" is the default if functions are present. + * + * @param functionCall the functionCall value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setFunctionCall(FunctionCallModelBase functionCall) { + this.functionCall = functionCall; + return this; + } + + /** + * Get the maxTokens property: The maximum number of tokens to generate. + * + * @return the maxTokens value. + */ + @Generated + public Integer getMaxTokens() { + return this.maxTokens; + } + + /** + * Set the maxTokens property: The maximum number of tokens to generate. + * + * @param maxTokens the maxTokens value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setMaxTokens(Integer maxTokens) { + this.maxTokens = maxTokens; + return this; + } + + /** + * Get the temperature property: The sampling temperature to use that controls the apparent creativity of generated + * completions. Higher values will make output more random while lower values will make results more focused and + * deterministic. It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Set the temperature property: The sampling temperature to use that controls the apparent creativity of generated + * completions. Higher values will make output more random while lower values will make results more focused and + * deterministic. It is not recommended to modify temperature and top_p for the same completions request as the + * interaction of these two settings is difficult to predict. + * + * @param temperature the temperature value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setTemperature(Double temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get the topP property: An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a value of 0.15 will + * cause only the tokens comprising the top 15% of probability mass to be considered. It is not recommended to + * modify temperature and top_p for the same completions request as the interaction of these two settings is + * difficult to predict. + * + * @return the topP value. + */ + @Generated + public Double getTopP() { + return this.topP; + } + + /** + * Set the topP property: An alternative to sampling with temperature called nucleus sampling. This value causes the + * model to consider the results of tokens with the provided probability mass. As an example, a value of 0.15 will + * cause only the tokens comprising the top 15% of probability mass to be considered. It is not recommended to + * modify temperature and top_p for the same completions request as the interaction of these two settings is + * difficult to predict. + * + * @param topP the topP value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setTopP(Double topP) { + this.topP = topP; + return this; + } + + /** + * Get the logitBias property: A map between GPT token IDs and bias scores that influences the probability of + * specific tokens appearing in a completions response. Token IDs are computed via external tokenizer tools, while + * bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to a full ban or + * exclusive selection of a token, respectively. The exact behavior of a given bias score varies by model. + * + * @return the logitBias value. + */ + @Generated + public Map getLogitBias() { + return this.logitBias; + } + + /** + * Set the logitBias property: A map between GPT token IDs and bias scores that influences the probability of + * specific tokens appearing in a completions response. Token IDs are computed via external tokenizer tools, while + * bias scores reside in the range of -100 to 100 with minimum and maximum values corresponding to a full ban or + * exclusive selection of a token, respectively. The exact behavior of a given bias score varies by model. + * + * @param logitBias the logitBias value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setLogitBias(Map logitBias) { + this.logitBias = logitBias; + return this; + } + + /** + * Get the user property: An identifier for the caller or end user of the operation. This may be used for tracking + * or rate-limiting purposes. + * + * @return the user value. + */ + @Generated + public String getUser() { + return this.user; + } + + /** + * Set the user property: An identifier for the caller or end user of the operation. This may be used for tracking + * or rate-limiting purposes. + * + * @param user the user value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setUser(String user) { + this.user = user; + return this; + } + + /** + * Get the n property: The number of chat completions choices that should be generated for a chat completions + * response. Because this setting can generate many completions, it may quickly consume your token quota. Use + * carefully and ensure reasonable settings for max_tokens and stop. + * + * @return the n value. + */ + @Generated + public Integer getN() { + return this.n; + } + + /** + * Set the n property: The number of chat completions choices that should be generated for a chat completions + * response. Because this setting can generate many completions, it may quickly consume your token quota. Use + * carefully and ensure reasonable settings for max_tokens and stop. + * + * @param n the n value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setN(Integer n) { + this.n = n; + return this; + } + + /** + * Get the stop property: A collection of textual sequences that will end completions generation. + * + * @return the stop value. + */ + @Generated + public List getStop() { + return this.stop; + } + + /** + * Set the stop property: A collection of textual sequences that will end completions generation. + * + * @param stop the stop value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setStop(List stop) { + this.stop = stop; + return this; + } + + /** + * Get the presencePenalty property: A value that influences the probability of generated tokens appearing based on + * their existing presence in generated text. Positive values will make tokens less likely to appear when they + * already exist and increase the model's likelihood to output new topics. + * + * @return the presencePenalty value. + */ + @Generated + public Double getPresencePenalty() { + return this.presencePenalty; + } + + /** + * Set the presencePenalty property: A value that influences the probability of generated tokens appearing based on + * their existing presence in generated text. Positive values will make tokens less likely to appear when they + * already exist and increase the model's likelihood to output new topics. + * + * @param presencePenalty the presencePenalty value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setPresencePenalty(Double presencePenalty) { + this.presencePenalty = presencePenalty; + return this; + } + + /** + * Get the frequencyPenalty property: A value that influences the probability of generated tokens appearing based on + * their cumulative frequency in generated text. Positive values will make tokens less likely to appear as their + * frequency increases and decrease the likelihood of the model repeating the same statements verbatim. + * + * @return the frequencyPenalty value. + */ + @Generated + public Double getFrequencyPenalty() { + return this.frequencyPenalty; + } + + /** + * Set the frequencyPenalty property: A value that influences the probability of generated tokens appearing based on + * their cumulative frequency in generated text. Positive values will make tokens less likely to appear as their + * frequency increases and decrease the likelihood of the model repeating the same statements verbatim. + * + * @param frequencyPenalty the frequencyPenalty value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setFrequencyPenalty(Double frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + return this; + } + + /** + * Get the stream property: A value indicating whether chat completions should be streamed for this request. + * + * @return the stream value. + */ + @Generated + public Boolean isStream() { + return this.stream; + } + + /** + * Set the stream property: A value indicating whether chat completions should be streamed for this request. + * + * @param stream the stream value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setStream(Boolean stream) { + this.stream = stream; + return this; + } + + /** + * Get the model property: The model name to provide as part of this completions request. Not applicable to Azure + * OpenAI, where deployment information should be included in the Azure resource URI that's connected to. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Set the model property: The model name to provide as part of this completions request. Not applicable to Azure + * OpenAI, where deployment information should be included in the Azure resource URI that's connected to. + * + * @param model the model value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setModel(String model) { + this.model = model; + return this; + } + + /** + * Get the dataSources property: The configuration entries for Azure OpenAI chat extensions that use them. This + * additional specification is only compatible with Azure OpenAI. + * + * @return the dataSources value. + */ + @Generated + public List getDataSources() { + return this.dataSources; + } + + /** + * Set the dataSources property: The configuration entries for Azure OpenAI chat extensions that use them. This + * additional specification is only compatible with Azure OpenAI. + * + * @param dataSources the dataSources value to set. + * @return the ChatCompletionsOptions object itself. + */ + @Generated + public ChatCompletionsOptions setDataSources(List dataSources) { + this.dataSources = dataSources; + return this; + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/DataModelBase.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/DataModelBase.java new file mode 100644 index 000000000000..fc47b818a061 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/DataModelBase.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.implementation.models; + +/** The DataModelBase model. */ +public abstract class DataModelBase { + /** Creates an instance of DataModelBase class. */ + protected DataModelBase() {} +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageGenerations.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageGenerations.java new file mode 100644 index 000000000000..fd238c531737 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageGenerations.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** The result of the operation if the operation succeeded. */ +@Immutable +public final class ImageGenerations { + + /* + * A timestamp when this job or item was created (in unix epochs). + */ + @Generated + @JsonProperty(value = "created") + private long createdAt; + + /* + * The images generated by the operator. + */ + @Generated + @JsonProperty(value = "data") + private DataModelBase data; + + /** + * Creates an instance of ImageGenerations class. + * + * @param createdAt the createdAt value to set. + * @param data the data value to set. + */ + @Generated + public ImageGenerations(OffsetDateTime createdAt, DataModelBase data) { + this.createdAt = createdAt.toEpochSecond(); + this.data = data; + } + + @Generated + @JsonCreator + private ImageGenerations( + @JsonProperty(value = "created") long createdAt, @JsonProperty(value = "data") DataModelBase data) { + this(OffsetDateTime.ofInstant(Instant.ofEpochSecond(createdAt), ZoneOffset.UTC), data); + } + + /** + * Get the createdAt property: A timestamp when this job or item was created (in unix epochs). + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the data property: The images generated by the operator. + * + * @return the data value. + */ + @Generated + public DataModelBase getData() { + return this.data; + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageLocationListDataModel.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageLocationListDataModel.java new file mode 100644 index 000000000000..91df04df4682 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageLocationListDataModel.java @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.implementation.models; + +import com.azure.ai.openai.models.ImageLocation; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.List; + +/** The ImageLocationListDataModel model. */ +@Immutable +public final class ImageLocationListDataModel extends DataModelBase { + private final List value; + + /** + * Creates an instance of ImageLocationListDataModel class. + * + * @param value the value. + */ + public ImageLocationListDataModel(List value) { + this.value = value; + } + + /** + * Gets the value. + * + * @return the value. + */ + @JsonValue + public List getValue() { + return this.value; + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImagePayload.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImagePayload.java new file mode 100644 index 000000000000..e894a83bd558 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImagePayload.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** An image response item that directly represents the image data as a base64-encoded string. */ +@Immutable +public final class ImagePayload { + + /* + * The complete data for an image represented as a base64-encoded string. + */ + @Generated + @JsonProperty(value = "b64_json") + private String base64Data; + + /** + * Creates an instance of ImagePayload class. + * + * @param base64Data the base64Data value to set. + */ + @Generated + @JsonCreator + public ImagePayload(@JsonProperty(value = "b64_json") String base64Data) { + this.base64Data = base64Data; + } + + /** + * Get the base64Data property: The complete data for an image represented as a base64-encoded string. + * + * @return the base64Data value. + */ + @Generated + public String getBase64Data() { + return this.base64Data; + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImagePayloadListDataModel.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImagePayloadListDataModel.java new file mode 100644 index 000000000000..b6c5c36562c7 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImagePayloadListDataModel.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.openai.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.List; + +/** The ImagePayloadListDataModel model. */ +@Immutable +public final class ImagePayloadListDataModel extends DataModelBase { + private final List value; + + /** + * Creates an instance of ImagePayloadListDataModel class. + * + * @param value the value. + */ + public ImagePayloadListDataModel(List value) { + this.value = value; + } + + /** + * Gets the value. + * + * @return the value. + */ + @JsonValue + public List getValue() { + return this.value; + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/package-info.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/package-info.java index b13d7b0f681e..6a7aeeb59c06 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/package-info.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/package-info.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - /** Package containing the data models for OpenAI. Azure OpenAI APIs for completions and search. */ package com.azure.ai.openai.implementation.models; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/package-info.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/package-info.java index 722ea38f511c..ae676025a6b6 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/package-info.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/package-info.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. - /** Package containing the implementations for OpenAI. Azure OpenAI APIs for completions and search. */ package com.azure.ai.openai.implementation; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTaskLabel.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTaskLabel.java index 36f8361ad2a4..abb7bb764636 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTaskLabel.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTaskLabel.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscription.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscription.java index 8d7b085ce8af..4a75b68faffa 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscription.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscription.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscriptionSegment.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscriptionSegment.java index 87e289da3b0e..e0e6def47459 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscriptionSegment.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscriptionSegment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslation.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslation.java index 7c798bbbec16..626486a2e84e 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslation.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslationSegment.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslationSegment.java index fcfac6d1332d..e0891c361232 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslationSegment.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslationSegment.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java index f40d72f04140..998f268a5ade 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java index 18fec2bc18c4..96c08bcea576 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java index d124691b2312..3adaaa402e5c 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureChatExtensionsMessageContext.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Fluent; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchChatExtensionConfiguration.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchChatExtensionConfiguration.java index 0109a18946b9..05e48f596265 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchChatExtensionConfiguration.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchChatExtensionConfiguration.java @@ -1,8 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; @@ -10,7 +12,8 @@ * A specific representation of configurable options for Azure Cognitive Search when using it as an Azure OpenAI chat * extension. */ -public class AzureCognitiveSearchChatExtensionConfiguration { +@Fluent +public final class AzureCognitiveSearchChatExtensionConfiguration { /* * The absolute endpoint path for the Azure Cognitive Search resource to use. @@ -39,9 +42,9 @@ public class AzureCognitiveSearchChatExtensionConfiguration { */ @JsonCreator public AzureCognitiveSearchChatExtensionConfiguration( - @JsonProperty(value = "endpoint") String endpoint, - @JsonProperty(value = "key") String key, - @JsonProperty(value = "indexName") String indexName) { + @JsonProperty(value = "endpoint") String endpoint, + @JsonProperty(value = "key") String key, + @JsonProperty(value = "indexName") String indexName) { this.endpoint = endpoint; this.key = key; this.indexName = indexName; @@ -106,4 +109,232 @@ public AzureCognitiveSearchChatExtensionConfiguration setIndexName(String indexN this.indexName = indexName; return this; } + + /* + * The type label to use when configuring Azure OpenAI chat extensions. This should typically not be changed from + * its + * default value for Azure Cognitive Search. + */ + @Generated + @JsonProperty(value = "type") + private AzureChatExtensionType type = AzureChatExtensionType.AZURE_COGNITIVE_SEARCH; + + /* + * Customized field mapping behavior to use when interacting with the search index. + */ + @Generated + @JsonProperty(value = "fieldsMapping") + private AzureCognitiveSearchIndexFieldMappingOptions fieldsMapping; + + /* + * The configured top number of documents to feature for the configured query. + */ + @Generated + @JsonProperty(value = "topNDocuments") + private Integer topNDocuments; + + /* + * The query type to use with Azure Cognitive Search. + */ + @Generated + @JsonProperty(value = "queryType") + private AzureCognitiveSearchQueryType queryType; + + /* + * Whether queries should be restricted to use of indexed data. + */ + @Generated + @JsonProperty(value = "inScope") + private Boolean inScope; + + /* + * The additional semantic configuration for the query. + */ + @Generated + @JsonProperty(value = "semanticConfiguration") + private String semanticConfiguration; + + /* + * When using embeddings for search, specifies the resource URL from which embeddings should be retrieved. + */ + @Generated + @JsonProperty(value = "embeddingEndpoint") + private String embeddingEndpoint; + + /* + * When using embeddings, specifies the API key to use with the provided embeddings endpoint. + */ + @Generated + @JsonProperty(value = "embeddingKey") + private String embeddingKey; + + /** + * Get the type property: The type label to use when configuring Azure OpenAI chat extensions. This should typically + * not be changed from its default value for Azure Cognitive Search. + * + * @return the type value. + */ + @Generated + public AzureChatExtensionType getType() { + return this.type; + } + + /** + * Get the fieldsMapping property: Customized field mapping behavior to use when interacting with the search index. + * + * @return the fieldsMapping value. + */ + @Generated + public AzureCognitiveSearchIndexFieldMappingOptions getFieldsMapping() { + return this.fieldsMapping; + } + + /** + * Set the fieldsMapping property: Customized field mapping behavior to use when interacting with the search index. + * + * @param fieldsMapping the fieldsMapping value to set. + * @return the AzureCognitiveSearchChatExtensionConfiguration object itself. + */ + @Generated + public AzureCognitiveSearchChatExtensionConfiguration setFieldsMapping( + AzureCognitiveSearchIndexFieldMappingOptions fieldsMapping) { + this.fieldsMapping = fieldsMapping; + return this; + } + + /** + * Get the topNDocuments property: The configured top number of documents to feature for the configured query. + * + * @return the topNDocuments value. + */ + @Generated + public Integer getTopNDocuments() { + return this.topNDocuments; + } + + /** + * Set the topNDocuments property: The configured top number of documents to feature for the configured query. + * + * @param topNDocuments the topNDocuments value to set. + * @return the AzureCognitiveSearchChatExtensionConfiguration object itself. + */ + @Generated + public AzureCognitiveSearchChatExtensionConfiguration setTopNDocuments(Integer topNDocuments) { + this.topNDocuments = topNDocuments; + return this; + } + + /** + * Get the queryType property: The query type to use with Azure Cognitive Search. + * + * @return the queryType value. + */ + @Generated + public AzureCognitiveSearchQueryType getQueryType() { + return this.queryType; + } + + /** + * Set the queryType property: The query type to use with Azure Cognitive Search. + * + * @param queryType the queryType value to set. + * @return the AzureCognitiveSearchChatExtensionConfiguration object itself. + */ + @Generated + public AzureCognitiveSearchChatExtensionConfiguration setQueryType(AzureCognitiveSearchQueryType queryType) { + this.queryType = queryType; + return this; + } + + /** + * Get the inScope property: Whether queries should be restricted to use of indexed data. + * + * @return the inScope value. + */ + @Generated + public Boolean isInScope() { + return this.inScope; + } + + /** + * Set the inScope property: Whether queries should be restricted to use of indexed data. + * + * @param inScope the inScope value to set. + * @return the AzureCognitiveSearchChatExtensionConfiguration object itself. + */ + @Generated + public AzureCognitiveSearchChatExtensionConfiguration setInScope(Boolean inScope) { + this.inScope = inScope; + return this; + } + + /** + * Get the semanticConfiguration property: The additional semantic configuration for the query. + * + * @return the semanticConfiguration value. + */ + @Generated + public String getSemanticConfiguration() { + return this.semanticConfiguration; + } + + /** + * Set the semanticConfiguration property: The additional semantic configuration for the query. + * + * @param semanticConfiguration the semanticConfiguration value to set. + * @return the AzureCognitiveSearchChatExtensionConfiguration object itself. + */ + @Generated + public AzureCognitiveSearchChatExtensionConfiguration setSemanticConfiguration(String semanticConfiguration) { + this.semanticConfiguration = semanticConfiguration; + return this; + } + + /** + * Get the embeddingEndpoint property: When using embeddings for search, specifies the resource URL from which + * embeddings should be retrieved. + * + * @return the embeddingEndpoint value. + */ + @Generated + public String getEmbeddingEndpoint() { + return this.embeddingEndpoint; + } + + /** + * Set the embeddingEndpoint property: When using embeddings for search, specifies the resource URL from which + * embeddings should be retrieved. + * + * @param embeddingEndpoint the embeddingEndpoint value to set. + * @return the AzureCognitiveSearchChatExtensionConfiguration object itself. + */ + @Generated + public AzureCognitiveSearchChatExtensionConfiguration setEmbeddingEndpoint(String embeddingEndpoint) { + this.embeddingEndpoint = embeddingEndpoint; + return this; + } + + /** + * Get the embeddingKey property: When using embeddings, specifies the API key to use with the provided embeddings + * endpoint. + * + * @return the embeddingKey value. + */ + @Generated + public String getEmbeddingKey() { + return this.embeddingKey; + } + + /** + * Set the embeddingKey property: When using embeddings, specifies the API key to use with the provided embeddings + * endpoint. + * + * @param embeddingKey the embeddingKey value to set. + * @return the AzureCognitiveSearchChatExtensionConfiguration object itself. + */ + @Generated + public AzureCognitiveSearchChatExtensionConfiguration setEmbeddingKey(String embeddingKey) { + this.embeddingKey = embeddingKey; + return this; + } } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchIndexFieldMappingOptions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchIndexFieldMappingOptions.java new file mode 100644 index 000000000000..49aec90d7490 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchIndexFieldMappingOptions.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Optional settings to control how fields are processed when using a configured Azure Cognitive Search resource. */ +@Fluent +public final class AzureCognitiveSearchIndexFieldMappingOptions { + + /* + * The name of the index field to use as a title. + */ + @Generated + @JsonProperty(value = "titleField") + private String titleField; + + /* + * The name of the index field to use as a URL. + */ + @Generated + @JsonProperty(value = "urlField") + private String urlField; + + /* + * The name of the index field to use as a filepath. + */ + @Generated + @JsonProperty(value = "filepathField") + private String filepathField; + + /* + * The names of index fields that should be treated as content. + */ + @Generated + @JsonProperty(value = "contentFieldNames") + private List contentFieldNames; + + /* + * The separator pattern that content fields should use. + */ + @Generated + @JsonProperty(value = "contentFieldSeparator") + private String contentFieldSeparator; + + /* + * The names of fields that represent vector data. + */ + @Generated + @JsonProperty(value = "vectorFields") + private List vectorFields; + + /** Creates an instance of AzureCognitiveSearchIndexFieldMappingOptions class. */ + @Generated + public AzureCognitiveSearchIndexFieldMappingOptions() {} + + /** + * Get the titleField property: The name of the index field to use as a title. + * + * @return the titleField value. + */ + @Generated + public String getTitleField() { + return this.titleField; + } + + /** + * Set the titleField property: The name of the index field to use as a title. + * + * @param titleField the titleField value to set. + * @return the AzureCognitiveSearchIndexFieldMappingOptions object itself. + */ + @Generated + public AzureCognitiveSearchIndexFieldMappingOptions setTitleField(String titleField) { + this.titleField = titleField; + return this; + } + + /** + * Get the urlField property: The name of the index field to use as a URL. + * + * @return the urlField value. + */ + @Generated + public String getUrlField() { + return this.urlField; + } + + /** + * Set the urlField property: The name of the index field to use as a URL. + * + * @param urlField the urlField value to set. + * @return the AzureCognitiveSearchIndexFieldMappingOptions object itself. + */ + @Generated + public AzureCognitiveSearchIndexFieldMappingOptions setUrlField(String urlField) { + this.urlField = urlField; + return this; + } + + /** + * Get the filepathField property: The name of the index field to use as a filepath. + * + * @return the filepathField value. + */ + @Generated + public String getFilepathField() { + return this.filepathField; + } + + /** + * Set the filepathField property: The name of the index field to use as a filepath. + * + * @param filepathField the filepathField value to set. + * @return the AzureCognitiveSearchIndexFieldMappingOptions object itself. + */ + @Generated + public AzureCognitiveSearchIndexFieldMappingOptions setFilepathField(String filepathField) { + this.filepathField = filepathField; + return this; + } + + /** + * Get the contentFieldNames property: The names of index fields that should be treated as content. + * + * @return the contentFieldNames value. + */ + @Generated + public List getContentFieldNames() { + return this.contentFieldNames; + } + + /** + * Set the contentFieldNames property: The names of index fields that should be treated as content. + * + * @param contentFieldNames the contentFieldNames value to set. + * @return the AzureCognitiveSearchIndexFieldMappingOptions object itself. + */ + @Generated + public AzureCognitiveSearchIndexFieldMappingOptions setContentFieldNames(List contentFieldNames) { + this.contentFieldNames = contentFieldNames; + return this; + } + + /** + * Get the contentFieldSeparator property: The separator pattern that content fields should use. + * + * @return the contentFieldSeparator value. + */ + @Generated + public String getContentFieldSeparator() { + return this.contentFieldSeparator; + } + + /** + * Set the contentFieldSeparator property: The separator pattern that content fields should use. + * + * @param contentFieldSeparator the contentFieldSeparator value to set. + * @return the AzureCognitiveSearchIndexFieldMappingOptions object itself. + */ + @Generated + public AzureCognitiveSearchIndexFieldMappingOptions setContentFieldSeparator(String contentFieldSeparator) { + this.contentFieldSeparator = contentFieldSeparator; + return this; + } + + /** + * Get the vectorFields property: The names of fields that represent vector data. + * + * @return the vectorFields value. + */ + @Generated + public List getVectorFields() { + return this.vectorFields; + } + + /** + * Set the vectorFields property: The names of fields that represent vector data. + * + * @param vectorFields the vectorFields value to set. + * @return the AzureCognitiveSearchIndexFieldMappingOptions object itself. + */ + @Generated + public AzureCognitiveSearchIndexFieldMappingOptions setVectorFields(List vectorFields) { + this.vectorFields = vectorFields; + return this; + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchQueryType.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchQueryType.java new file mode 100644 index 000000000000..a1c2d93675ac --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchQueryType.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.openai.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** + * The type of Azure Cognitive Search retrieval query that should be executed when using it as an Azure OpenAI chat + * extension. + */ +public final class AzureCognitiveSearchQueryType extends ExpandableStringEnum { + + /** Represents the default, simple query parser. */ + @Generated public static final AzureCognitiveSearchQueryType SIMPLE = fromString("simple"); + + /** Represents the semantic query parser for advanced semantic modeling. */ + @Generated public static final AzureCognitiveSearchQueryType SEMANTIC = fromString("semantic"); + + /** Represents vector search over computed data. */ + @Generated public static final AzureCognitiveSearchQueryType VECTOR = fromString("vector"); + + /** Represents a combination of the simple query strategy with vector data. */ + @Generated + public static final AzureCognitiveSearchQueryType VECTOR_SIMPLE_HYBRID = fromString("vectorSimpleHybrid"); + + /** Represents a combination of semantic search and vector data querying. */ + @Generated + public static final AzureCognitiveSearchQueryType VECTOR_SEMANTIC_HYBRID = fromString("vectorSemanticHybrid"); + + /** + * Creates a new instance of AzureCognitiveSearchQueryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public AzureCognitiveSearchQueryType() {} + + /** + * Creates or finds a AzureCognitiveSearchQueryType from its string representation. + * + * @param name a name to look for. + * @return the corresponding AzureCognitiveSearchQueryType. + */ + @Generated + @JsonCreator + public static AzureCognitiveSearchQueryType fromString(String name) { + return fromString(name, AzureCognitiveSearchQueryType.class); + } + + /** + * Gets known AzureCognitiveSearchQueryType values. + * + * @return known AzureCognitiveSearchQueryType values. + */ + @Generated + public static Collection values() { + return values(AzureCognitiveSearchQueryType.class); + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureOpenAIOperationState.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureOpenAIOperationState.java index fe41121d7f21..3eb3c5f37158 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureOpenAIOperationState.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureOpenAIOperationState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; @@ -26,13 +26,6 @@ public final class AzureOpenAIOperationState extends ExpandableStringEnum { + + /** Image generation response items should provide a URL from which the image may be retrieved. */ + @Generated public static final ImageGenerationResponseFormat URL = fromString("url"); + + /** Image generation response items should provide image data as a base64-encoded string. */ + @Generated public static final ImageGenerationResponseFormat BASE64 = fromString("b64_json"); + + /** + * Creates a new instance of ImageGenerationResponseFormat value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ImageGenerationResponseFormat() {} + + /** + * Creates or finds a ImageGenerationResponseFormat from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageGenerationResponseFormat. + */ + @Generated + @JsonCreator + public static ImageGenerationResponseFormat fromString(String name) { + return fromString(name, ImageGenerationResponseFormat.class); + } + + /** + * Gets known ImageGenerationResponseFormat values. + * + * @return known ImageGenerationResponseFormat values. + */ + @Generated + public static Collection values() { + return values(ImageGenerationResponseFormat.class); + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageLocation.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageLocation.java index 967a0021b0b8..c1e1b11226a7 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageLocation.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageLocation.java @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.azure.core.models.ResponseError; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -/** The image url if successful, and an error otherwise. */ +/** An image response item that provides a URL from which an image may be accessed. */ @Immutable public final class ImageLocation { @@ -19,17 +19,6 @@ public final class ImageLocation { @JsonProperty(value = "url") private String url; - /* - * The error if the operation failed. - */ - @Generated - @JsonProperty(value = "error") - private ResponseError error; - - /** Creates an instance of ImageLocation class. */ - @Generated - private ImageLocation() {} - /** * Get the url property: The URL that provides temporary access to download the generated image. * @@ -41,12 +30,13 @@ public String getUrl() { } /** - * Get the error property: The error if the operation failed. + * Creates an instance of ImageLocation class. * - * @return the error value. + * @param url the url value to set. */ @Generated - public ResponseError getError() { - return this.error; + @JsonCreator + public ImageLocation(@JsonProperty(value = "url") String url) { + this.url = url; } } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageSize.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageSize.java index ff84856a6347..9d7b36f40219 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageSize.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageSize.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.openai.models; import com.azure.core.annotation.Generated; diff --git a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/ReadmeSamples.java b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/ReadmeSamples.java index df80c246ad77..a95384f1a0e2 100644 --- a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/ReadmeSamples.java +++ b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/impl/ReadmeSamples.java @@ -30,7 +30,6 @@ import com.azure.core.credential.KeyCredential; import com.azure.core.credential.TokenCredential; import com.azure.core.http.ProxyOptions; -import com.azure.core.models.ResponseError; import com.azure.core.util.BinaryData; import com.azure.core.util.HttpClientOptions; import com.azure.core.util.IterableStream; @@ -218,15 +217,9 @@ public void imageGeneration() { ImageResponse images = client.getImages(imageGenerationOptions); for (ImageLocation imageLocation : images.getData()) { - ResponseError error = imageLocation.getError(); - if (error != null) { - System.out.printf("Image generation operation failed. Error code: %s, error message: %s.%n", - error.getCode(), error.getMessage()); - } else { - System.out.printf( - "Image location URL that provides temporary access to download the generated image is %s.%n", - imageLocation.getUrl()); - } + System.out.printf( + "Image location URL that provides temporary access to download the generated image is %s.%n", + imageLocation.getUrl()); } // END: readme-sample-imageGeneration } diff --git a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetImagesAsyncSample.java b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetImagesAsyncSample.java index 472aba4540eb..79c246c128c8 100644 --- a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetImagesAsyncSample.java +++ b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetImagesAsyncSample.java @@ -8,7 +8,6 @@ import com.azure.ai.openai.models.ImageGenerationOptions; import com.azure.ai.openai.models.ImageLocation; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.models.ResponseError; import java.util.concurrent.TimeUnit; @@ -36,15 +35,9 @@ public static void main(String[] args) throws InterruptedException { client.getImages(imageGenerationOptions).subscribe( images -> { for (ImageLocation imageLocation : images.getData()) { - ResponseError error = imageLocation.getError(); - if (error != null) { - System.out.printf("Image generation operation failed. Error code: %s, error message: %s.%n", - error.getCode(), error.getMessage()); - } else { - System.out.printf( - "Image location URL that provides temporary access to download the generated image is %s.%n", - imageLocation.getUrl()); - } + System.out.printf( + "Image location URL that provides temporary access to download the generated image is %s.%n", + imageLocation.getUrl()); } }, error -> System.err.println("There was an error getting images." + error), diff --git a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetImagesSample.java b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetImagesSample.java index 014015d49bef..b5029228d97d 100644 --- a/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetImagesSample.java +++ b/sdk/openai/azure-ai-openai/src/samples/java/com/azure/ai/openai/usage/GetImagesSample.java @@ -9,7 +9,6 @@ import com.azure.ai.openai.models.ImageLocation; import com.azure.ai.openai.models.ImageResponse; import com.azure.core.credential.AzureKeyCredential; -import com.azure.core.models.ResponseError; /** * Sample demonstrates how to get the images for a given prompt. @@ -34,15 +33,9 @@ public static void main(String[] args) { ImageResponse images = client.getImages(imageGenerationOptions); for (ImageLocation imageLocation : images.getData()) { - ResponseError error = imageLocation.getError(); - if (error != null) { - System.out.printf("Image generation operation failed. Error code: %s, error message: %s.%n", - error.getCode(), error.getMessage()); - } else { - System.out.printf( - "Image location URL that provides temporary access to download the generated image is %s.%n", - imageLocation.getUrl()); - } + System.out.printf( + "Image location URL that provides temporary access to download the generated image is %s.%n", + imageLocation.getUrl()); } } } diff --git a/sdk/openai/azure-ai-openai/src/test/java/com/azure/ai/openai/OpenAIClientTestBase.java b/sdk/openai/azure-ai-openai/src/test/java/com/azure/ai/openai/OpenAIClientTestBase.java index 063f687dc2fc..1f243947647f 100644 --- a/sdk/openai/azure-ai-openai/src/test/java/com/azure/ai/openai/OpenAIClientTestBase.java +++ b/sdk/openai/azure-ai-openai/src/test/java/com/azure/ai/openai/OpenAIClientTestBase.java @@ -173,7 +173,7 @@ void getChatCompletionsForNonAzureRunner(BiConsumer> t void getChatCompletionsAzureChatSearchRunner(BiConsumer testRunner) { ChatCompletionsOptions chatCompletionsOptions = new ChatCompletionsOptions( Arrays.asList(new ChatMessage(ChatRole.USER, "What does PR complete mean?"))); - testRunner.accept("gpt-4-0613", chatCompletionsOptions); + testRunner.accept("gpt-35-turbo-16k", chatCompletionsOptions); } void getEmbeddingRunner(BiConsumer testRunner) { diff --git a/sdk/openai/azure-ai-openai/tsp-location.yaml b/sdk/openai/azure-ai-openai/tsp-location.yaml index 9dbc49d97eac..90bc737f61d0 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 +commit: 817861452040bf29d14b57ac7418560e4680e06e repo: Azure/azure-rest-api-specs