diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 4797a09f9902..fd5d8239a8b9 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,6 +1,6 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.10.0" + "@azure-tools/typespec-java": "0.11.1" } } \ No newline at end of file diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java index 72393823a3de..5bb0ecf45448 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIAsyncClient.java @@ -15,6 +15,7 @@ import com.azure.ai.openai.implementation.NonAzureOpenAIClientImpl; import com.azure.ai.openai.implementation.OpenAIClientImpl; import com.azure.ai.openai.implementation.OpenAIServerSentEvents; +import com.azure.ai.openai.implementation.models.BatchImageGenerationOperationResponse; import com.azure.ai.openai.models.AudioTranscription; import com.azure.ai.openai.models.AudioTranscriptionOptions; import com.azure.ai.openai.models.AudioTranslation; @@ -47,11 +48,14 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous OpenAIClient type. */ +/** + * Initializes a new instance of the asynchronous OpenAIClient type. + */ @ServiceClient(builder = OpenAIClientBuilder.class, isAsync = true) public final class OpenAIAsyncClient { - @Generated private final OpenAIClientImpl serviceClient; + @Generated + private final OpenAIClientImpl serviceClient; private static final ClientLogger LOGGER = new ClientLogger(OpenAIAsyncClient.class); @@ -84,7 +88,8 @@ public final class OpenAIAsyncClient { /** * Return the embeddings for a given prompt. * - *

Request Body Schema + *

+ * Request Body Schema * *

{@code
      * {
@@ -96,7 +101,8 @@ public final class OpenAIAsyncClient {
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -116,34 +122,34 @@ public final class OpenAIAsyncClient {
      * }
* * @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. + * (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. + * 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 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}. + * 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> getEmbeddingsWithResponse( - String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { + public Mono> getEmbeddingsWithResponse(String deploymentOrModelName, + BinaryData embeddingsOptions, RequestOptions requestOptions) { return openAIServiceClient != null - ? openAIServiceClient.getEmbeddingsWithResponseAsync( - deploymentOrModelName, embeddingsOptions, requestOptions) - : serviceClient.getEmbeddingsWithResponseAsync( - deploymentOrModelName, embeddingsOptions, requestOptions); + ? openAIServiceClient.getEmbeddingsWithResponseAsync(deploymentOrModelName, embeddingsOptions, + requestOptions) + : serviceClient.getEmbeddingsWithResponseAsync(deploymentOrModelName, embeddingsOptions, requestOptions); } /** * Gets completions for the provided input prompts. Completions support a wide variety of tasks and generate text * that continues from or "completes" provided prompt data. * - *

Request Body Schema + *

+ * Request Body Schema * *

{@code
      * {
@@ -171,7 +177,8 @@ public Mono> getEmbeddingsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -209,33 +216,33 @@ public Mono> getEmbeddingsWithResponse(
      * }
* * @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. + * (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. + * 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 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}. + * that continues from or "completes" provided prompt data along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCompletionsWithResponse( - String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + public Mono> getCompletionsWithResponse(String deploymentOrModelName, + BinaryData completionsOptions, RequestOptions requestOptions) { return openAIServiceClient != null - ? openAIServiceClient.getCompletionsWithResponseAsync( - deploymentOrModelName, completionsOptions, requestOptions) - : serviceClient.getCompletionsWithResponseAsync( - deploymentOrModelName, completionsOptions, requestOptions); + ? openAIServiceClient.getCompletionsWithResponseAsync(deploymentOrModelName, completionsOptions, + requestOptions) + : serviceClient.getCompletionsWithResponseAsync(deploymentOrModelName, completionsOptions, requestOptions); } /** * Gets chat completions for the provided chat messages. Completions support a wide variety of tasks and generate * text that continues from or "completes" provided prompt data. * - *

Request Body Schema + *

+ * Request Body Schema * *

{@code
      * {
@@ -263,7 +270,8 @@ public Mono> getCompletionsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -292,32 +300,33 @@ public Mono> getCompletionsWithResponse(
      * }
* * @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. + * (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. + * 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. 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}. + * text that continues from or "completes" provided prompt data along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getChatCompletionsWithResponse( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + public Mono> getChatCompletionsWithResponse(String deploymentOrModelName, + BinaryData chatCompletionsOptions, RequestOptions requestOptions) { return openAIServiceClient != null - ? openAIServiceClient.getChatCompletionsWithResponseAsync( - deploymentOrModelName, chatCompletionsOptions, requestOptions) - : serviceClient.getChatCompletionsWithResponseAsync( - deploymentOrModelName, chatCompletionsOptions, requestOptions); + ? openAIServiceClient.getChatCompletionsWithResponseAsync(deploymentOrModelName, chatCompletionsOptions, + requestOptions) + : serviceClient.getChatCompletionsWithResponseAsync(deploymentOrModelName, chatCompletionsOptions, + requestOptions); } /** * Return the embeddings for a given prompt. * - *

Request Body Schema + *

+ * Request Body Schema * *

{@code
      * {
@@ -329,7 +338,8 @@ public Mono> getChatCompletionsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -349,24 +359,24 @@ public Mono> getChatCompletionsWithResponse(
      * }
* * @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. + * (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. + * 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 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}. + * 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> getEmbeddingsWithResponse( - String deploymentOrModelName, EmbeddingsOptions embeddingsOptions, RequestOptions requestOptions) { - return getEmbeddingsWithResponse( - deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), requestOptions) + public Mono> getEmbeddingsWithResponse(String deploymentOrModelName, + EmbeddingsOptions embeddingsOptions, RequestOptions requestOptions) { + return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), + requestOptions) .map(response -> new SimpleResponse<>(response, response.getValue().toObject(Embeddings.class))); } @@ -374,7 +384,8 @@ public Mono> getEmbeddingsWithResponse( * 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 + *

+ * Request Body Schema * *

{@code
      * {
@@ -402,7 +413,8 @@ public Mono> getEmbeddingsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -440,23 +452,23 @@ public Mono> getEmbeddingsWithResponse(
      * }
* * @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. + * (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. + * 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 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}. + * that continues from or "completes" provided prompt data along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCompletionsWithResponse( - String deploymentOrModelName, CompletionsOptions completionsOptions, RequestOptions requestOptions) { - return getCompletionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(completionsOptions), requestOptions) + public Mono> getCompletionsWithResponse(String deploymentOrModelName, + CompletionsOptions completionsOptions, RequestOptions requestOptions) { + return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(completionsOptions), + requestOptions) .map(response -> new SimpleResponse<>(response, response.getValue().toObject(Completions.class))); } @@ -464,7 +476,8 @@ public Mono> getCompletionsWithResponse( * 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 + *

+ * Request Body Schema * *

{@code
      * {
@@ -492,7 +505,8 @@ public Mono> getCompletionsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -521,25 +535,23 @@ public Mono> getCompletionsWithResponse(
      * }
* * @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. + * (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. + * 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. 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}. + * text that continues from or "completes" provided prompt data along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getChatCompletionsWithResponse( - String deploymentOrModelName, - ChatCompletionsOptions chatCompletionsOptions, - RequestOptions requestOptions) { - return getChatCompletionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions), requestOptions) + public Mono> getChatCompletionsWithResponse(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions, RequestOptions requestOptions) { + return getChatCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions), + requestOptions) .map(response -> new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class))); } @@ -547,56 +559,57 @@ public Mono> getChatCompletionsWithResponse( * Return the embeddings for a given prompt. * * @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. + * (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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @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 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 on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getEmbeddings(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions) { // Generated convenience method for getEmbeddingsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getEmbeddingsWithResponse( - deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), requestOptions) - .flatMap(FluxUtil::toMono) + return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), + requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Embeddings.class)); } /** - * 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 completions for the provided input prompts. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. * * @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. + * (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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @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 on successful completion of {@link Mono}. + * @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 on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono getCompletions(String deploymentOrModelName, CompletionsOptions completionsOptions) { // Generated convenience method for getCompletionsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getCompletionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(completionsOptions), requestOptions) - .flatMap(FluxUtil::toMono) + return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(completionsOptions), + requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Completions.class)); } @@ -605,7 +618,7 @@ public Mono getCompletions(String deploymentOrModelName, Completion * that continues from or "completes" provided prompt data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param prompt The prompt to generate completion text from. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -614,7 +627,7 @@ public Mono getCompletions(String deploymentOrModelName, Completion * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @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 on successful completion of {@link Mono}. + * that continues from or "completes" provided prompt data on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getCompletions(String deploymentOrModelName, String prompt) { @@ -626,9 +639,9 @@ public Mono getCompletions(String deploymentOrModelName, String pro * generate text that continues from or "completes" provided prompt data. * * @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. + * (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. + * variety of tasks and generate text that continues from or "completes" provided prompt data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -636,18 +649,17 @@ public Mono getCompletions(String deploymentOrModelName, String pro * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a {@link Flux} of completions for the provided input prompts. Completions support a wide variety of tasks - * and generate text that continues from or "completes" provided prompt data. + * and generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) public Flux getCompletionsStream(String deploymentOrModelName, CompletionsOptions completionsOptions) { completionsOptions.setStream(true); RequestOptions requestOptions = new RequestOptions(); BinaryData requestBody = BinaryData.fromObject(completionsOptions); - Flux responseStream = - getCompletionsWithResponse(deploymentOrModelName, requestBody, requestOptions) - .flatMapMany(response -> response.getValue().toFluxByteBuffer()); - OpenAIServerSentEvents completionsStream = - new OpenAIServerSentEvents<>(responseStream, Completions.class); + Flux responseStream = getCompletionsWithResponse(deploymentOrModelName, requestBody, requestOptions) + .flatMapMany(response -> response.getValue().toFluxByteBuffer()); + OpenAIServerSentEvents completionsStream + = new OpenAIServerSentEvents<>(responseStream, Completions.class); return completionsStream.getEvents(); } @@ -656,9 +668,9 @@ public Flux getCompletionsStream(String deploymentOrModelName, Comp * text that continues from or "completes" provided prompt data. * * @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. + * (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. + * wide variety of tasks and generate text that continues from or "completes" provided prompt data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -666,19 +678,18 @@ public Flux getCompletionsStream(String deploymentOrModelName, Comp * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @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 on successful completion of {@link Mono}. + * text that continues from or "completes" provided prompt data on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getChatCompletions( - String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions) { + public Mono getChatCompletions(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions) { RequestOptions requestOptions = new RequestOptions(); if (chatCompletionsOptions.getDataSources() == null || chatCompletionsOptions.getDataSources().isEmpty()) { return getChatCompletionsWithResponse(deploymentOrModelName, chatCompletionsOptions, requestOptions) - .flatMap(FluxUtil::toMono); + .flatMap(FluxUtil::toMono); } else { - return getChatCompletionsWithAzureExtensionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions), requestOptions) - .flatMap(FluxUtil::toMono) + return getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(chatCompletionsOptions), requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class)); } } @@ -688,9 +699,9 @@ public Mono getChatCompletions( * generate text that continues from or "completes" provided prompt data. * * @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. + * (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. + * wide variety of tasks and generate text that continues from or "completes" provided prompt data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -698,31 +709,25 @@ public Mono getChatCompletions( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return chat completions stream for the provided chat messages. Completions support a wide variety of tasks and - * generate text that continues from or "completes" provided prompt data. + * generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public Flux getChatCompletionsStream( - String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions) { + public Flux getChatCompletionsStream(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions) { chatCompletionsOptions.setStream(true); RequestOptions requestOptions = new RequestOptions(); Flux responseStream; if (chatCompletionsOptions.getDataSources() == null || chatCompletionsOptions.getDataSources().isEmpty()) { - responseStream = - getChatCompletionsWithResponse( - deploymentOrModelName, - BinaryData.fromObject(chatCompletionsOptions), - requestOptions) - .flatMapMany(response -> response.getValue().toFluxByteBuffer()); + responseStream + = getChatCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions), + requestOptions).flatMapMany(response -> response.getValue().toFluxByteBuffer()); } else { - responseStream = - getChatCompletionsWithAzureExtensionsWithResponse( - deploymentOrModelName, - BinaryData.fromObject(chatCompletionsOptions), - requestOptions) - .flatMapMany(response -> response.getValue().toFluxByteBuffer()); + responseStream = getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(chatCompletionsOptions), requestOptions) + .flatMapMany(response -> response.getValue().toFluxByteBuffer()); } - OpenAIServerSentEvents chatCompletionsStream = - new OpenAIServerSentEvents<>(responseStream, ChatCompletions.class); + OpenAIServerSentEvents chatCompletionsStream + = new OpenAIServerSentEvents<>(responseStream, ChatCompletions.class); return chatCompletionsStream.getEvents(); } @@ -743,21 +748,17 @@ public Mono getImages(ImageGenerationOptions imageGenerationOptio RequestOptions requestOptions = new RequestOptions(); BinaryData imageGenerationOptionsBinaryData = BinaryData.fromObject(imageGenerationOptions); return openAIServiceClient != null - ? openAIServiceClient - .generateImageWithResponseAsync(imageGenerationOptionsBinaryData, requestOptions) - .flatMap(FluxUtil::toMono) - .map(it -> it.toObject(ImageResponse.class)) - : beginBeginAzureBatchImageGeneration(imageGenerationOptionsBinaryData, requestOptions) - .last() - .flatMap(it -> it.getFinalResult()) - .map(it -> it.toObject(ImageOperationResponse.class).getResult()); + ? openAIServiceClient.generateImageWithResponseAsync(imageGenerationOptionsBinaryData, requestOptions) + .flatMap(FluxUtil::toMono).map(it -> it.toObject(ImageResponse.class)) + : beginBeginAzureBatchImageGeneration(imageGenerationOptionsBinaryData, requestOptions).last() + .flatMap(it -> it.getFinalResult()).map(it -> it.toObject(ImageOperationResponse.class).getResult()); } /** * Starts the generation of a batch of images from a text caption. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     prompt: String (Required)
@@ -767,9 +768,9 @@ public Mono getImages(ImageGenerationOptions imageGenerationOptio
      *     user: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -777,7 +778,7 @@ public Mono getImages(ImageGenerationOptions imageGenerationOptio
      *     expires: Long (Optional)
      *     result (Optional): {
      *         created: long (Required)
-     *         data: DataModelBase (Required)
+     *         data: BinaryData (Required)
      *     }
      *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
      *     error (Optional): {
@@ -802,24 +803,22 @@ public Mono getImages(ImageGenerationOptions imageGenerationOptio
      * @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.
+     * operation.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
-    PollerFlux beginBeginAzureBatchImageGeneration(
-            BinaryData imageGenerationOptions, RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'beginAzureBatchImageGeneration' refers Union 'ImageLocation[]
-        // | ImagePayload[]'
+    PollerFlux beginBeginAzureBatchImageGeneration(BinaryData imageGenerationOptions,
+        RequestOptions requestOptions) {
         return this.serviceClient.beginBeginAzureBatchImageGenerationAsync(imageGenerationOptions, requestOptions);
     }
 
     /**
-     * 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 - * + * 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
      * {
      *     messages (Required): [
@@ -845,7 +844,7 @@ PollerFlux beginBeginAzureBatchImageGeneration(
      *             parameters: Object (Optional)
      *         }
      *     ]
-     *     function_call: FunctionCallModelBase (Optional)
+     *     function_call: BinaryData (Optional)
      *     max_tokens: Integer (Optional)
      *     temperature: Double (Optional)
      *     top_p: Double (Optional)
@@ -869,9 +868,9 @@ PollerFlux beginBeginAzureBatchImageGeneration(
      *     ]
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -933,34 +932,34 @@ PollerFlux beginBeginAzureBatchImageGeneration(
      * }
* * @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. + * (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 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 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}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getChatCompletionsWithAzureExtensionsWithResponse( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { - // Convenience API is not generated, as operation 'getChatCompletionsWithAzureExtensions' refers Union - // 'FunctionCallPreset | FunctionName' - return this.serviceClient.getChatCompletionsWithAzureExtensionsWithResponseAsync( - deploymentOrModelName, chatCompletionsOptions, requestOptions); + Mono> getChatCompletionsWithAzureExtensionsWithResponse(String deploymentOrModelName, + BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + return this.serviceClient.getChatCompletionsWithAzureExtensionsWithResponseAsync(deploymentOrModelName, + chatCompletionsOptions, requestOptions); } /** * Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the * written language corresponding to the language it was spoken in. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     file: byte[] (Required)
@@ -971,9 +970,9 @@ Mono> getChatCompletionsWithAzureExtensionsWithResponse(
      *     model: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     text: String (Required)
@@ -1000,7 +999,7 @@ Mono> getChatCompletionsWithAzureExtensionsWithResponse(
      * }
* * @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. + * (when using non-Azure OpenAI) to use for this request. * @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. @@ -1008,16 +1007,16 @@ Mono> getChatCompletionsWithAzureExtensionsWithResponse( * @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}. + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAudioTranscriptionAsResponseObjectWithResponse( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + Mono> getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName, + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation // 'getAudioTranscriptionAsResponseObject' is 'multipart/form-data' - return this.serviceClient.getAudioTranscriptionAsResponseObjectWithResponseAsync( - deploymentOrModelName, audioTranscriptionOptions, requestOptions); + return this.serviceClient.getAudioTranscriptionAsResponseObjectWithResponseAsync(deploymentOrModelName, + audioTranscriptionOptions, requestOptions); } /** @@ -1025,7 +1024,7 @@ Mono> getAudioTranscriptionAsResponseObjectWithResponse( * the written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranscriptionOptions} * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1035,13 +1034,13 @@ Mono> getAudioTranscriptionAsResponseObjectWithResponse( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return {@link AudioTranscription} transcribed text and associated metadata from provided spoken audio data on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAudioTranscription( - String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions) { + public Mono getAudioTranscription(String deploymentOrModelName, String fileName, + AudioTranscriptionOptions audioTranscriptionOptions) { return getAudioTranscriptionWithResponse(deploymentOrModelName, fileName, audioTranscriptionOptions, null) - .map(Response::getValue); + .map(Response::getValue); } /** @@ -1049,7 +1048,7 @@ public Mono getAudioTranscription( * the written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranscriptionOptions} * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1060,14 +1059,11 @@ public Mono getAudioTranscription( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return {@link AudioTranscription} transcribed text and associated metadata from provided spoken audio data on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranscriptionWithResponse( - String deploymentOrModelName, - String fileName, - AudioTranscriptionOptions audioTranscriptionOptions, - RequestOptions requestOptions) { + public Mono> getAudioTranscriptionWithResponse(String deploymentOrModelName, + String fileName, AudioTranscriptionOptions audioTranscriptionOptions, RequestOptions requestOptions) { // checking allowed formats for a JSON response try { validateAudioResponseFormatForTranscription(audioTranscriptionOptions); @@ -1082,16 +1078,13 @@ public Mono> getAudioTranscriptionWithResponse( final MultipartDataSerializationResult result = helper.serializeRequest(audioTranscriptionOptions, fileName); final BinaryData data = result.getData(); requestOptions = helper.getRequestOptionsForMultipartFormData(requestOptions, result, helper.getBoundary()); - Mono> response = - openAIServiceClient != null - ? this.openAIServiceClient.getAudioTranscriptionAsResponseObjectWithResponseAsync( - deploymentOrModelName, data, requestOptions) - : this.serviceClient.getAudioTranscriptionAsResponseObjectWithResponseAsync( - deploymentOrModelName, data, requestOptions); - return response.map( - responseBinaryData -> - new SimpleResponse<>( - responseBinaryData, responseBinaryData.getValue().toObject(AudioTranscription.class))); + Mono> response = openAIServiceClient != null + ? this.openAIServiceClient.getAudioTranscriptionAsResponseObjectWithResponseAsync(deploymentOrModelName, + data, requestOptions) + : this.serviceClient.getAudioTranscriptionAsResponseObjectWithResponseAsync(deploymentOrModelName, data, + requestOptions); + return response.map(responseBinaryData -> new SimpleResponse<>(responseBinaryData, + responseBinaryData.getValue().toObject(AudioTranscription.class))); } /** @@ -1099,7 +1092,7 @@ public Mono> getAudioTranscriptionWithResponse( * the written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranscriptionOptions} * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1109,13 +1102,13 @@ public Mono> getAudioTranscriptionWithResponse( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return transcribed text and associated metadata from provided spoken audio data on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAudioTranscriptionText( - String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions) { + public Mono getAudioTranscriptionText(String deploymentOrModelName, String fileName, + AudioTranscriptionOptions audioTranscriptionOptions) { return getAudioTranscriptionTextWithResponse(deploymentOrModelName, fileName, audioTranscriptionOptions, null) - .map(Response::getValue); + .map(Response::getValue); } /** @@ -1123,7 +1116,7 @@ public Mono getAudioTranscriptionText( * the written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranscriptionOptions} * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1134,14 +1127,11 @@ public Mono getAudioTranscriptionText( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return transcribed text and associated metadata from provided spoken audio file data along with {@link Response} - * on successful completion of {@link Mono}. + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranscriptionTextWithResponse( - String deploymentOrModelName, - String fileName, - AudioTranscriptionOptions audioTranscriptionOptions, - RequestOptions requestOptions) { + public Mono> getAudioTranscriptionTextWithResponse(String deploymentOrModelName, String fileName, + AudioTranscriptionOptions audioTranscriptionOptions, RequestOptions requestOptions) { // checking allowed formats for a plain text response try { validateAudioResponseFormatForTranscriptionText(audioTranscriptionOptions); @@ -1156,12 +1146,11 @@ public Mono> getAudioTranscriptionTextWithResponse( final MultipartDataSerializationResult result = helper.serializeRequest(audioTranscriptionOptions, fileName); final BinaryData data = result.getData(); requestOptions = helper.getRequestOptionsForMultipartFormData(requestOptions, result, helper.getBoundary()); - Mono> response = - openAIServiceClient != null - ? this.openAIServiceClient.getAudioTranscriptionAsPlainTextWithResponseAsync( - deploymentOrModelName, data, requestOptions) - : this.serviceClient.getAudioTranscriptionAsPlainTextWithResponseAsync( - deploymentOrModelName, data, requestOptions); + Mono> response = openAIServiceClient != null + ? this.openAIServiceClient.getAudioTranscriptionAsPlainTextWithResponseAsync(deploymentOrModelName, data, + requestOptions) + : this.serviceClient.getAudioTranscriptionAsPlainTextWithResponseAsync(deploymentOrModelName, data, + requestOptions); return response.map(dataResponse -> new SimpleResponse<>(dataResponse, dataResponse.getValue().toString())); } @@ -1169,7 +1158,7 @@ public Mono> getAudioTranscriptionTextWithResponse( * Gets English language transcribed text and associated metadata from provided spoken audio file data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranslationOptions} * @param audioTranslationOptions The configuration information for an audio translation request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1179,20 +1168,20 @@ public Mono> getAudioTranscriptionTextWithResponse( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return {@link AudioTranslation} english language transcribed text and associated metadata from provided spoken - * audio file data on successful completion of {@link Mono}. + * audio file data on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAudioTranslation( - String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions) { + public Mono getAudioTranslation(String deploymentOrModelName, String fileName, + AudioTranslationOptions audioTranslationOptions) { return getAudioTranslationWithResponse(deploymentOrModelName, fileName, audioTranslationOptions, null) - .map(Response::getValue); + .map(Response::getValue); } /** * Gets English language transcribed text and associated metadata from provided spoken audio file data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranslationOptions} * @param audioTranslationOptions The configuration information for an audio translation request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1203,14 +1192,11 @@ public Mono getAudioTranslation( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return {@link AudioTranslation} english language transcribed text and associated metadata from provided spoken - * audio file data along with {@link Response} on successful completion of {@link Mono}. + * audio file data along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranslationWithResponse( - String deploymentOrModelName, - String fileName, - AudioTranslationOptions audioTranslationOptions, - RequestOptions requestOptions) { + public Mono> getAudioTranslationWithResponse(String deploymentOrModelName, + String fileName, AudioTranslationOptions audioTranslationOptions, RequestOptions requestOptions) { // checking allowed formats for a JSON response try { validateAudioResponseFormatForTranslation(audioTranslationOptions); @@ -1225,23 +1211,20 @@ public Mono> getAudioTranslationWithResponse( final MultipartDataSerializationResult result = helper.serializeRequest(audioTranslationOptions, fileName); final BinaryData data = result.getData(); requestOptions = helper.getRequestOptionsForMultipartFormData(requestOptions, result, helper.getBoundary()); - Mono> response = - openAIServiceClient != null - ? this.openAIServiceClient.getAudioTranslationAsResponseObjectWithResponseAsync( - deploymentOrModelName, data, requestOptions) - : this.serviceClient.getAudioTranslationAsResponseObjectWithResponseAsync( - deploymentOrModelName, data, requestOptions); - return response.map( - responseBinaryData -> - new SimpleResponse<>( - responseBinaryData, responseBinaryData.getValue().toObject(AudioTranslation.class))); + Mono> response = openAIServiceClient != null + ? this.openAIServiceClient.getAudioTranslationAsResponseObjectWithResponseAsync(deploymentOrModelName, data, + requestOptions) + : this.serviceClient.getAudioTranslationAsResponseObjectWithResponseAsync(deploymentOrModelName, data, + requestOptions); + return response.map(responseBinaryData -> new SimpleResponse<>(responseBinaryData, + responseBinaryData.getValue().toObject(AudioTranslation.class))); } /** * Gets English language transcribed text and associated metadata from provided spoken audio file data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranslationOptions}. * @param audioTranslationOptions The configuration information for an audio translation request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1251,20 +1234,20 @@ public Mono> getAudioTranslationWithResponse( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return english language transcribed text and associated metadata from provided spoken audio file data on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAudioTranslationText( - String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions) { + public Mono getAudioTranslationText(String deploymentOrModelName, String fileName, + AudioTranslationOptions audioTranslationOptions) { return getAudioTranslationTextWithResponse(deploymentOrModelName, fileName, audioTranslationOptions, null) - .map(Response::getValue); + .map(Response::getValue); } /** * Gets English language transcribed text and associated metadata from provided spoken audio file data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranslationOptions}. * @param audioTranslationOptions The configuration information for an audio translation request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1275,14 +1258,11 @@ public Mono getAudioTranslationText( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return english language transcribed text and associated metadata from provided spoken audio file data on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranslationTextWithResponse( - String deploymentOrModelName, - String fileName, - AudioTranslationOptions audioTranslationOptions, - RequestOptions requestOptions) { + public Mono> getAudioTranslationTextWithResponse(String deploymentOrModelName, String fileName, + AudioTranslationOptions audioTranslationOptions, RequestOptions requestOptions) { // checking allowed formats for a JSON response try { validateAudioResponseFormatForTranslationText(audioTranslationOptions); @@ -1297,23 +1277,21 @@ public Mono> getAudioTranslationTextWithResponse( final MultipartDataSerializationResult result = helper.serializeRequest(audioTranslationOptions, fileName); final BinaryData data = result.getData(); requestOptions = helper.getRequestOptionsForMultipartFormData(requestOptions, result, helper.getBoundary()); - Mono> response = - openAIServiceClient != null - ? this.openAIServiceClient.getAudioTranslationAsPlainTextWithResponseAsync( - deploymentOrModelName, data, requestOptions) - : this.serviceClient.getAudioTranslationAsPlainTextWithResponseAsync( - deploymentOrModelName, data, requestOptions); + Mono> response = openAIServiceClient != null + ? this.openAIServiceClient.getAudioTranslationAsPlainTextWithResponseAsync(deploymentOrModelName, data, + requestOptions) + : this.serviceClient.getAudioTranslationAsPlainTextWithResponseAsync(deploymentOrModelName, data, + requestOptions); return response.map( - responseBinaryData -> - new SimpleResponse<>(responseBinaryData, responseBinaryData.getValue().toString())); + responseBinaryData -> new SimpleResponse<>(responseBinaryData, responseBinaryData.getValue().toString())); } /** * 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 - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     file: byte[] (Required)
@@ -1324,15 +1302,15 @@ public Mono> getAudioTranslationTextWithResponse(
      *     model: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * 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. + * (when using non-Azure OpenAI) to use for this request. * @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. @@ -1340,21 +1318,21 @@ public Mono> getAudioTranslationTextWithResponse( * @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}. + * successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranscriptionAsPlainTextWithResponse( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { - return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponseAsync( - deploymentOrModelName, audioTranscriptionOptions, requestOptions); + public Mono> getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponseAsync(deploymentOrModelName, + audioTranscriptionOptions, requestOptions); } /** * Gets English language transcribed text and associated metadata from provided spoken audio data. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     file: byte[] (Required)
@@ -1364,9 +1342,9 @@ public Mono> getAudioTranscriptionAsPlainTextWithResponse(
      *     model: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     text: String (Required)
@@ -1393,7 +1371,7 @@ public Mono> getAudioTranscriptionAsPlainTextWithResponse(
      * }
* * @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. + * (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. @@ -1401,23 +1379,23 @@ public Mono> getAudioTranscriptionAsPlainTextWithResponse( * @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}. + * {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAudioTranslationAsResponseObjectWithResponse( - String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { + Mono> getAudioTranslationAsResponseObjectWithResponse(String deploymentOrModelName, + BinaryData audioTranslationOptions, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation // 'getAudioTranslationAsResponseObject' is 'multipart/form-data' - return this.serviceClient.getAudioTranslationAsResponseObjectWithResponseAsync( - deploymentOrModelName, audioTranslationOptions, requestOptions); + return this.serviceClient.getAudioTranslationAsResponseObjectWithResponseAsync(deploymentOrModelName, + audioTranslationOptions, requestOptions); } /** * Gets English language transcribed text and associated metadata from provided spoken audio data. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     file: byte[] (Required)
@@ -1427,15 +1405,15 @@ Mono> getAudioTranslationAsResponseObjectWithResponse(
      *     model: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * 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. + * (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. @@ -1443,14 +1421,14 @@ Mono> getAudioTranslationAsResponseObjectWithResponse( * @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}. + * {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAudioTranslationAsPlainTextWithResponse( - String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { - return this.serviceClient.getAudioTranslationAsPlainTextWithResponseAsync( - deploymentOrModelName, audioTranslationOptions, requestOptions); + public Mono> getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, + BinaryData audioTranslationOptions, RequestOptions requestOptions) { + return this.serviceClient.getAudioTranslationAsPlainTextWithResponseAsync(deploymentOrModelName, + audioTranslationOptions, requestOptions); } /** @@ -1458,7 +1436,7 @@ public Mono> getAudioTranslationAsPlainTextWithResponse( * written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1467,17 +1445,16 @@ public Mono> getAudioTranslationAsPlainTextWithResponse( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return transcribed text and associated metadata from provided spoken audio data on successful completion of - * {@link Mono}. + * {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAudioTranscriptionAsPlainText( - String deploymentOrModelName, AudioTranscriptionOptions audioTranscriptionOptions) { + public Mono getAudioTranscriptionAsPlainText(String deploymentOrModelName, + AudioTranscriptionOptions audioTranscriptionOptions) { // Generated convenience method for getAudioTranscriptionAsPlainTextWithResponse RequestOptions requestOptions = new RequestOptions(); - return getAudioTranscriptionAsPlainTextWithResponse( - deploymentOrModelName, BinaryData.fromObject(audioTranscriptionOptions), requestOptions) - .flatMap(FluxUtil::toMono) + return getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, + BinaryData.fromObject(audioTranscriptionOptions), requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(String.class)); } @@ -1485,7 +1462,7 @@ public Mono getAudioTranscriptionAsPlainText( * Gets English language transcribed text and associated metadata from provided spoken audio data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param audioTranslationOptions The configuration information for an audio translation request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1494,17 +1471,70 @@ public Mono getAudioTranscriptionAsPlainText( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return english language transcribed text and associated metadata from provided spoken audio data on successful - * completion of {@link Mono}. + * completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAudioTranslationAsPlainText( - String deploymentOrModelName, AudioTranslationOptions audioTranslationOptions) { + public Mono getAudioTranslationAsPlainText(String deploymentOrModelName, + AudioTranslationOptions audioTranslationOptions) { // Generated convenience method for getAudioTranslationAsPlainTextWithResponse RequestOptions requestOptions = new RequestOptions(); - return getAudioTranslationAsPlainTextWithResponse( - deploymentOrModelName, BinaryData.fromObject(audioTranslationOptions), requestOptions) - .flatMap(FluxUtil::toMono) + return getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, + BinaryData.fromObject(audioTranslationOptions), requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(String.class)); } + + /** + * 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. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @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 on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getChatCompletionsWithAzureExtensions(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions) { + // Generated convenience method for getChatCompletionsWithAzureExtensionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(chatCompletionsOptions), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class)); + } + + /** + * Starts the generation of a batch of images from a text caption. + * + * @param imageGenerationOptions Represents the request data used to generate images. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of a polling status update or final response payload for an image + * operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux + beginBeginAzureBatchImageGeneration(ImageGenerationOptions imageGenerationOptions) { + // Generated convenience method for beginBeginAzureBatchImageGenerationWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginBeginAzureBatchImageGenerationWithModelAsync( + BinaryData.fromObject(imageGenerationOptions), requestOptions); + } } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java index 7e9e3d8cc174..ee4a52f60126 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClient.java @@ -14,6 +14,7 @@ import com.azure.ai.openai.implementation.NonAzureOpenAIClientImpl; import com.azure.ai.openai.implementation.OpenAIClientImpl; import com.azure.ai.openai.implementation.OpenAIServerSentEvents; +import com.azure.ai.openai.implementation.models.BatchImageGenerationOperationResponse; import com.azure.ai.openai.models.AudioTranscription; import com.azure.ai.openai.models.AudioTranscriptionOptions; import com.azure.ai.openai.models.AudioTranslation; @@ -45,13 +46,16 @@ import java.nio.ByteBuffer; import reactor.core.publisher.Flux; -/** Initializes a new instance of the synchronous OpenAIClient type. */ +/** + * Initializes a new instance of the synchronous OpenAIClient type. + */ @ServiceClient(builder = OpenAIClientBuilder.class) public final class OpenAIClient { private static final ClientLogger LOGGER = new ClientLogger(OpenAIClient.class); - @Generated private final OpenAIClientImpl serviceClient; + @Generated + private final OpenAIClientImpl serviceClient; private final NonAzureOpenAIClientImpl openAIServiceClient; @@ -78,7 +82,8 @@ public final class OpenAIClient { /** * Return the embeddings for a given prompt. * - *

Request Body Schema + *

+ * Request Body Schema * *

{@code
      * {
@@ -90,7 +95,8 @@ public final class OpenAIClient {
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -110,33 +116,33 @@ public final class OpenAIClient {
      * }
* * @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. + * (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. + * 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 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}. + * text strings and are commonly used for search, clustering, recommendations, and other similar scenarios along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getEmbeddingsWithResponse( - String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { + public Response getEmbeddingsWithResponse(String deploymentOrModelName, BinaryData embeddingsOptions, + RequestOptions requestOptions) { return openAIServiceClient != null - ? openAIServiceClient.getEmbeddingsWithResponse( - deploymentOrModelName, embeddingsOptions, requestOptions) - : serviceClient.getEmbeddingsWithResponse(deploymentOrModelName, embeddingsOptions, requestOptions); + ? openAIServiceClient.getEmbeddingsWithResponse(deploymentOrModelName, embeddingsOptions, requestOptions) + : serviceClient.getEmbeddingsWithResponse(deploymentOrModelName, embeddingsOptions, requestOptions); } /** * Gets completions for the provided input prompts. Completions support a wide variety of tasks and generate text * that continues from or "completes" provided prompt data. * - *

Request Body Schema + *

+ * Request Body Schema * *

{@code
      * {
@@ -164,7 +170,8 @@ public Response getEmbeddingsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -202,31 +209,31 @@ public Response getEmbeddingsWithResponse(
      * }
* * @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. + * (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. + * 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 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}. + * that continues from or "completes" provided prompt data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCompletionsWithResponse( - String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + public Response getCompletionsWithResponse(String deploymentOrModelName, BinaryData completionsOptions, + RequestOptions requestOptions) { return openAIServiceClient != null - ? openAIServiceClient.getCompletionsWithResponse( - deploymentOrModelName, completionsOptions, requestOptions) - : serviceClient.getCompletionsWithResponse(deploymentOrModelName, completionsOptions, requestOptions); + ? openAIServiceClient.getCompletionsWithResponse(deploymentOrModelName, completionsOptions, requestOptions) + : serviceClient.getCompletionsWithResponse(deploymentOrModelName, completionsOptions, requestOptions); } /** * Gets chat completions for the provided chat messages. Completions support a wide variety of tasks and generate * text that continues from or "completes" provided prompt data. * - *

Request Body Schema + *

+ * Request Body Schema * *

{@code
      * {
@@ -254,7 +261,8 @@ public Response getCompletionsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -283,31 +291,32 @@ public Response getCompletionsWithResponse(
      * }
* * @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. + * (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. + * 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. Completions support a wide variety of tasks and generate - * text that continues from or "completes" provided prompt data along with {@link Response}. + * text that continues from or "completes" provided prompt data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getChatCompletionsWithResponse( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + public Response getChatCompletionsWithResponse(String deploymentOrModelName, + BinaryData chatCompletionsOptions, RequestOptions requestOptions) { return openAIServiceClient != null - ? openAIServiceClient.getChatCompletionsWithResponse( - deploymentOrModelName, chatCompletionsOptions, requestOptions) - : serviceClient.getChatCompletionsWithResponse( - deploymentOrModelName, chatCompletionsOptions, requestOptions); + ? openAIServiceClient.getChatCompletionsWithResponse(deploymentOrModelName, chatCompletionsOptions, + requestOptions) + : serviceClient.getChatCompletionsWithResponse(deploymentOrModelName, chatCompletionsOptions, + requestOptions); } /** * Return the embeddings for a given prompt. * - *

Request Body Schema + *

+ * Request Body Schema * *

{@code
      * {
@@ -319,7 +328,8 @@ public Response getChatCompletionsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -339,25 +349,24 @@ public Response getChatCompletionsWithResponse(
      * }
* * @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. + * (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. + * 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 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}. + * text strings and are commonly used for search, clustering, recommendations, and other similar scenarios along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getEmbeddingsWithResponse( - String deploymentOrModelName, EmbeddingsOptions embeddingsOptions, RequestOptions requestOptions) { - Response response = - getEmbeddingsWithResponse( - deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), requestOptions); + public Response getEmbeddingsWithResponse(String deploymentOrModelName, + EmbeddingsOptions embeddingsOptions, RequestOptions requestOptions) { + Response response = getEmbeddingsWithResponse(deploymentOrModelName, + BinaryData.fromObject(embeddingsOptions), requestOptions); return new SimpleResponse<>(response, response.getValue().toObject(Embeddings.class)); } @@ -365,7 +374,8 @@ public Response getEmbeddingsWithResponse( * 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 + *

+ * Request Body Schema * *

{@code
      * {
@@ -393,7 +403,8 @@ public Response getEmbeddingsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -431,23 +442,22 @@ public Response getEmbeddingsWithResponse(
      * }
* * @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. + * (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. + * 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 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}. + * that continues from or "completes" provided prompt data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCompletionsWithResponse( - String deploymentOrModelName, CompletionsOptions completionsOptions, RequestOptions requestOptions) { - Response response = - getCompletionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(completionsOptions), requestOptions); + public Response getCompletionsWithResponse(String deploymentOrModelName, + CompletionsOptions completionsOptions, RequestOptions requestOptions) { + Response response = getCompletionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(completionsOptions), requestOptions); return new SimpleResponse<>(response, response.getValue().toObject(Completions.class)); } @@ -455,7 +465,8 @@ public Response getCompletionsWithResponse( * 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 + *

+ * Request Body Schema * *

{@code
      * {
@@ -483,7 +494,8 @@ public Response getCompletionsWithResponse(
      * }
      * }
* - *

Response Body Schema + *

+ * Response Body Schema * *

{@code
      * {
@@ -512,25 +524,22 @@ public Response getCompletionsWithResponse(
      * }
* * @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. + * (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. + * 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. Completions support a wide variety of tasks and generate - * text that continues from or "completes" provided prompt data along with {@link Response}. + * text that continues from or "completes" provided prompt data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getChatCompletionsWithResponse( - String deploymentOrModelName, - ChatCompletionsOptions chatCompletionsOptions, - RequestOptions requestOptions) { - Response response = - getChatCompletionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions), requestOptions); + public Response getChatCompletionsWithResponse(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions, RequestOptions requestOptions) { + Response response = getChatCompletionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(chatCompletionsOptions), requestOptions); return new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class)); } @@ -538,56 +547,56 @@ public Response getChatCompletionsWithResponse( * Return the embeddings for a given prompt. * * @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. + * (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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @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. + * @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. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Embeddings getEmbeddings(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions) { // Generated convenience method for getEmbeddingsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getEmbeddingsWithResponse( - deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), requestOptions) - .getValue() - .toObject(Embeddings.class); + return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), + requestOptions).getValue().toObject(Embeddings.class); } /** - * 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 completions for the provided input prompts. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. * * @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. + * (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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @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. + * @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. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Completions getCompletions(String deploymentOrModelName, CompletionsOptions completionsOptions) { // Generated convenience method for getCompletionsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getCompletionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(completionsOptions), requestOptions) - .getValue() - .toObject(Completions.class); + return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(completionsOptions), + requestOptions).getValue().toObject(Completions.class); } /** @@ -595,7 +604,7 @@ public Completions getCompletions(String deploymentOrModelName, CompletionsOptio * that continues from or "completes" provided prompt data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param prompt The prompt to generate completion text from. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -604,7 +613,7 @@ public Completions getCompletions(String deploymentOrModelName, CompletionsOptio * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @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. + * that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.SINGLE) public Completions getCompletions(String deploymentOrModelName, String prompt) { @@ -616,9 +625,9 @@ public Completions getCompletions(String deploymentOrModelName, String prompt) { * generate text that continues from or "completes" provided prompt data. * * @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. + * (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. + * variety of tasks and generate text that continues from or "completes" provided prompt data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -626,20 +635,17 @@ public Completions getCompletions(String deploymentOrModelName, String prompt) { * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return an {@link IterableStream} of completions for the provided input prompts. Completions support a wide - * variety of tasks and generate text that continues from or "completes" provided prompt data. + * variety of tasks and generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public IterableStream getCompletionsStream( - String deploymentOrModelName, CompletionsOptions completionsOptions) { + public IterableStream getCompletionsStream(String deploymentOrModelName, + CompletionsOptions completionsOptions) { completionsOptions.setStream(true); RequestOptions requestOptions = new RequestOptions(); - Flux responseStream = - getCompletionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(completionsOptions), requestOptions) - .getValue() - .toFluxByteBuffer(); - OpenAIServerSentEvents completionsStream = - new OpenAIServerSentEvents<>(responseStream, Completions.class); + Flux responseStream = getCompletionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(completionsOptions), requestOptions).getValue().toFluxByteBuffer(); + OpenAIServerSentEvents completionsStream + = new OpenAIServerSentEvents<>(responseStream, Completions.class); return new IterableStream<>(completionsStream.getEvents()); } @@ -648,9 +654,9 @@ public IterableStream getCompletionsStream( * text that continues from or "completes" provided prompt data. * * @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. + * (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. + * wide variety of tasks and generate text that continues from or "completes" provided prompt data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -658,19 +664,18 @@ public IterableStream getCompletionsStream( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @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. + * text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ChatCompletions getChatCompletions( - String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions) { + public ChatCompletions getChatCompletions(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions) { RequestOptions requestOptions = new RequestOptions(); if (chatCompletionsOptions.getDataSources() == null || chatCompletionsOptions.getDataSources().isEmpty()) { return getChatCompletionsWithResponse(deploymentOrModelName, chatCompletionsOptions, requestOptions) - .getValue(); + .getValue(); } else { - return getChatCompletionsWithAzureExtensionsWithResponse( - deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions), requestOptions) - .getValue() + return getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(chatCompletionsOptions), requestOptions).getValue() .toObject(ChatCompletions.class); } } @@ -680,9 +685,9 @@ public ChatCompletions getChatCompletions( * generate text that continues from or "completes" provided prompt data. * * @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. + * (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. + * wide variety of tasks and generate text that continues from or "completes" provided prompt data. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -690,33 +695,23 @@ public ChatCompletions getChatCompletions( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return chat completions stream for the provided chat messages. Completions support a wide variety of tasks and - * generate text that continues from or "completes" provided prompt data. + * generate text that continues from or "completes" provided prompt data. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public IterableStream getChatCompletionsStream( - String deploymentOrModelName, ChatCompletionsOptions chatCompletionsOptions) { + public IterableStream getChatCompletionsStream(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions) { chatCompletionsOptions.setStream(true); RequestOptions requestOptions = new RequestOptions(); Flux responseStream; if (chatCompletionsOptions.getDataSources() == null || chatCompletionsOptions.getDataSources().isEmpty()) { - responseStream = - getChatCompletionsWithResponse( - deploymentOrModelName, - BinaryData.fromObject(chatCompletionsOptions), - requestOptions) - .getValue() - .toFluxByteBuffer(); + responseStream = getChatCompletionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(chatCompletionsOptions), requestOptions).getValue().toFluxByteBuffer(); } else { - responseStream = - getChatCompletionsWithAzureExtensionsWithResponse( - deploymentOrModelName, - BinaryData.fromObject(chatCompletionsOptions), - requestOptions) - .getValue() - .toFluxByteBuffer(); + responseStream = getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(chatCompletionsOptions), requestOptions).getValue().toFluxByteBuffer(); } - OpenAIServerSentEvents chatCompletionsStream = - new OpenAIServerSentEvents<>(responseStream, ChatCompletions.class); + OpenAIServerSentEvents chatCompletionsStream + = new OpenAIServerSentEvents<>(responseStream, ChatCompletions.class); return new IterableStream<>(chatCompletionsStream.getEvents()); } @@ -737,23 +732,19 @@ public ImageResponse getImages(ImageGenerationOptions imageGenerationOptions) { RequestOptions requestOptions = new RequestOptions(); BinaryData imageGenerationOptionsBinaryData = BinaryData.fromObject(imageGenerationOptions); if (openAIServiceClient != null) { - return openAIServiceClient - .generateImageWithResponse(imageGenerationOptionsBinaryData, requestOptions) - .getValue() - .toObject(ImageResponse.class); + return openAIServiceClient.generateImageWithResponse(imageGenerationOptionsBinaryData, requestOptions) + .getValue().toObject(ImageResponse.class); } else { return beginBeginAzureBatchImageGeneration(imageGenerationOptionsBinaryData, requestOptions) - .getFinalResult() - .toObject(ImageOperationResponse.class) - .getResult(); + .getFinalResult().toObject(ImageOperationResponse.class).getResult(); } } /** * Starts the generation of a batch of images from a text caption. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     prompt: String (Required)
@@ -763,9 +754,9 @@ public ImageResponse getImages(ImageGenerationOptions imageGenerationOptions) {
      *     user: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -773,7 +764,7 @@ public ImageResponse getImages(ImageGenerationOptions imageGenerationOptions) {
      *     expires: Long (Optional)
      *     result (Optional): {
      *         created: long (Required)
-     *         data: DataModelBase (Required)
+     *         data: BinaryData (Required)
      *     }
      *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
      *     error (Optional): {
@@ -798,24 +789,22 @@ public ImageResponse getImages(ImageGenerationOptions imageGenerationOptions) {
      * @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.
+     * operation.
      */
     @Generated
     @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
-    SyncPoller beginBeginAzureBatchImageGeneration(
-            BinaryData imageGenerationOptions, RequestOptions requestOptions) {
-        // Convenience API is not generated, as operation 'beginAzureBatchImageGeneration' refers Union 'ImageLocation[]
-        // | ImagePayload[]'
+    SyncPoller beginBeginAzureBatchImageGeneration(BinaryData imageGenerationOptions,
+        RequestOptions requestOptions) {
         return this.serviceClient.beginBeginAzureBatchImageGeneration(imageGenerationOptions, requestOptions);
     }
 
     /**
-     * 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 - * + * 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
      * {
      *     messages (Required): [
@@ -841,7 +830,7 @@ SyncPoller beginBeginAzureBatchImageGeneration(
      *             parameters: Object (Optional)
      *         }
      *     ]
-     *     function_call: FunctionCallModelBase (Optional)
+     *     function_call: BinaryData (Optional)
      *     max_tokens: Integer (Optional)
      *     temperature: Double (Optional)
      *     top_p: Double (Optional)
@@ -865,9 +854,9 @@ SyncPoller beginBeginAzureBatchImageGeneration(
      *     ]
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -929,26 +918,25 @@ SyncPoller beginBeginAzureBatchImageGeneration(
      * }
* * @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. + * (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 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 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}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response getChatCompletionsWithAzureExtensionsWithResponse( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { - // Convenience API is not generated, as operation 'getChatCompletionsWithAzureExtensions' refers Union - // 'FunctionCallPreset | FunctionName' - return this.serviceClient.getChatCompletionsWithAzureExtensionsWithResponse( - deploymentOrModelName, chatCompletionsOptions, requestOptions); + Response getChatCompletionsWithAzureExtensionsWithResponse(String deploymentOrModelName, + BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + return this.serviceClient.getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName, + chatCompletionsOptions, requestOptions); } /** @@ -956,7 +944,7 @@ Response getChatCompletionsWithAzureExtensionsWithResponse( * the written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranscriptionOptions}. * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -968,10 +956,10 @@ Response getChatCompletionsWithAzureExtensionsWithResponse( * @return {@link AudioTranscription} transcribed text and associated metadata from provided spoken audio data. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AudioTranscription getAudioTranscription( - String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions) { + public AudioTranscription getAudioTranscription(String deploymentOrModelName, String fileName, + AudioTranscriptionOptions audioTranscriptionOptions) { return getAudioTranscriptionWithResponse(deploymentOrModelName, fileName, audioTranscriptionOptions, null) - .getValue(); + .getValue(); } /** @@ -979,7 +967,7 @@ public AudioTranscription getAudioTranscription( * the written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranscriptionOptions}. * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -990,14 +978,11 @@ public AudioTranscription getAudioTranscription( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return {@link AudioTranscription} transcribed text and associated metadata from provided spoken audio data along - * with {@link Response}. + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranscriptionWithResponse( - String deploymentOrModelName, - String fileName, - AudioTranscriptionOptions audioTranscriptionOptions, - RequestOptions requestOptions) { + public Response getAudioTranscriptionWithResponse(String deploymentOrModelName, String fileName, + AudioTranscriptionOptions audioTranscriptionOptions, RequestOptions requestOptions) { // checking allowed formats for a JSON response validateAudioResponseFormatForTranscription(audioTranscriptionOptions); // embedding the `model` in the request for non-Azure case @@ -1008,12 +993,11 @@ public Response getAudioTranscriptionWithResponse( final MultipartDataSerializationResult result = helper.serializeRequest(audioTranscriptionOptions, fileName); final BinaryData data = result.getData(); requestOptions = helper.getRequestOptionsForMultipartFormData(requestOptions, result, helper.getBoundary()); - Response response = - openAIServiceClient != null - ? this.openAIServiceClient.getAudioTranscriptionAsPlainTextWithResponse( - deploymentOrModelName, data, requestOptions) - : this.serviceClient.getAudioTranscriptionAsPlainTextWithResponse( - deploymentOrModelName, data, requestOptions); + Response response = openAIServiceClient != null + ? this.openAIServiceClient.getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, data, + requestOptions) + : this.serviceClient.getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, data, + requestOptions); return new SimpleResponse<>(response, response.getValue().toObject(AudioTranscription.class)); } @@ -1022,7 +1006,7 @@ public Response getAudioTranscriptionWithResponse( * the written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranscriptionOptions}. * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1034,10 +1018,10 @@ public Response getAudioTranscriptionWithResponse( * @return transcribed text and associated metadata from provided spoken audio data. */ @ServiceMethod(returns = ReturnType.SINGLE) - public String getAudioTranscriptionText( - String deploymentOrModelName, String fileName, AudioTranscriptionOptions audioTranscriptionOptions) { + public String getAudioTranscriptionText(String deploymentOrModelName, String fileName, + AudioTranscriptionOptions audioTranscriptionOptions) { return getAudioTranscriptionTextWithResponse(deploymentOrModelName, fileName, audioTranscriptionOptions, null) - .getValue(); + .getValue(); } /** @@ -1045,7 +1029,7 @@ public String getAudioTranscriptionText( * the written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranscriptionOptions}. * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1058,11 +1042,8 @@ public String getAudioTranscriptionText( * @return transcribed text and associated metadata from provided spoken audio data. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranscriptionTextWithResponse( - String deploymentOrModelName, - String fileName, - AudioTranscriptionOptions audioTranscriptionOptions, - RequestOptions requestOptions) { + public Response getAudioTranscriptionTextWithResponse(String deploymentOrModelName, String fileName, + AudioTranscriptionOptions audioTranscriptionOptions, RequestOptions requestOptions) { // checking allowed formats for a plain text response validateAudioResponseFormatForTranscriptionText(audioTranscriptionOptions); // embedding the `model` in the request for non-Azure case @@ -1073,12 +1054,11 @@ public Response getAudioTranscriptionTextWithResponse( final MultipartDataSerializationResult result = helper.serializeRequest(audioTranscriptionOptions, fileName); final BinaryData data = result.getData(); requestOptions = helper.getRequestOptionsForMultipartFormData(requestOptions, result, helper.getBoundary()); - Response response = - openAIServiceClient != null - ? this.openAIServiceClient.getAudioTranscriptionAsPlainTextWithResponse( - deploymentOrModelName, data, requestOptions) - : this.serviceClient.getAudioTranscriptionAsPlainTextWithResponse( - deploymentOrModelName, data, requestOptions); + Response response = openAIServiceClient != null + ? this.openAIServiceClient.getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, data, + requestOptions) + : this.serviceClient.getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, data, + requestOptions); return new SimpleResponse<>(response, response.getValue().toString()); } @@ -1086,7 +1066,7 @@ public Response getAudioTranscriptionTextWithResponse( * Gets English language transcribed text and associated metadata from provided spoken audio file data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranslationOptions}. * @param audioTranslationOptions The configuration information for an audio translation request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1096,20 +1076,20 @@ public Response getAudioTranscriptionTextWithResponse( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return {@link AudioTranscription} english language transcribed text and associated metadata from provided spoken - * audio file data. + * audio file data. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AudioTranslation getAudioTranslation( - String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions) { + public AudioTranslation getAudioTranslation(String deploymentOrModelName, String fileName, + AudioTranslationOptions audioTranslationOptions) { return getAudioTranslationWithResponse(deploymentOrModelName, fileName, audioTranslationOptions, null) - .getValue(); + .getValue(); } /** * Gets English language transcribed text and associated metadata from provided spoken audio file data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranslationOptions}. * @param audioTranslationOptions The configuration information for an audio translation request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1120,14 +1100,11 @@ public AudioTranslation getAudioTranslation( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return {@link AudioTranslation} english language transcribed text and associated metadata from provided spoken - * audio file data along with {@link Response}. + * audio file data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranslationWithResponse( - String deploymentOrModelName, - String fileName, - AudioTranslationOptions audioTranslationOptions, - RequestOptions requestOptions) { + public Response getAudioTranslationWithResponse(String deploymentOrModelName, String fileName, + AudioTranslationOptions audioTranslationOptions, RequestOptions requestOptions) { // checking allowed formats for a JSON response validateAudioResponseFormatForTranslation(audioTranslationOptions); // embedding the `model` in the request for non-Azure case @@ -1138,12 +1115,11 @@ public Response getAudioTranslationWithResponse( final MultipartDataSerializationResult result = helper.serializeRequest(audioTranslationOptions, fileName); final BinaryData data = result.getData(); requestOptions = helper.getRequestOptionsForMultipartFormData(requestOptions, result, helper.getBoundary()); - Response response = - openAIServiceClient != null - ? this.openAIServiceClient.getAudioTranslationAsPlainTextWithResponse( - deploymentOrModelName, data, requestOptions) - : this.serviceClient.getAudioTranslationAsPlainTextWithResponse( - deploymentOrModelName, data, requestOptions); + Response response = openAIServiceClient != null + ? this.openAIServiceClient.getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, data, + requestOptions) + : this.serviceClient.getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, data, + requestOptions); return new SimpleResponse<>(response, response.getValue().toObject(AudioTranslation.class)); } @@ -1151,7 +1127,7 @@ public Response getAudioTranslationWithResponse( * Gets English language transcribed text and associated metadata from provided spoken audio file data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranslationOptions}. * @param audioTranslationOptions The configuration information for an audio translation request. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1163,17 +1139,17 @@ public Response getAudioTranslationWithResponse( * @return english language transcribed text and associated metadata from provided spoken audio file data. */ @ServiceMethod(returns = ReturnType.SINGLE) - public String getAudioTranslationText( - String deploymentOrModelName, String fileName, AudioTranslationOptions audioTranslationOptions) { + public String getAudioTranslationText(String deploymentOrModelName, String fileName, + AudioTranslationOptions audioTranslationOptions) { return getAudioTranslationTextWithResponse(deploymentOrModelName, fileName, audioTranslationOptions, null) - .getValue(); + .getValue(); } /** * Gets English language transcribed text and associated metadata from provided spoken audio file data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param fileName The file name that is represented in the {@code file} field of {@link AudioTranslationOptions}. * @param audioTranslationOptions The configuration information for an audio translation request. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -1184,14 +1160,11 @@ public String getAudioTranslationText( * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return english language transcribed text and associated metadata from provided spoken audio file data along with - * {@link Response}. + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranslationTextWithResponse( - String deploymentOrModelName, - String fileName, - AudioTranslationOptions audioTranslationOptions, - RequestOptions requestOptions) { + public Response getAudioTranslationTextWithResponse(String deploymentOrModelName, String fileName, + AudioTranslationOptions audioTranslationOptions, RequestOptions requestOptions) { // checking allowed formats for a plain text response validateAudioResponseFormatForTranslationText(audioTranslationOptions); // embedding the `model` in the request for non-Azure case @@ -1202,21 +1175,20 @@ public Response getAudioTranslationTextWithResponse( final MultipartDataSerializationResult result = helper.serializeRequest(audioTranslationOptions, fileName); final BinaryData data = result.getData(); requestOptions = helper.getRequestOptionsForMultipartFormData(requestOptions, result, helper.getBoundary()); - Response response = - openAIServiceClient != null - ? this.openAIServiceClient.getAudioTranslationAsPlainTextWithResponse( - deploymentOrModelName, data, requestOptions) - : this.serviceClient.getAudioTranslationAsPlainTextWithResponse( - deploymentOrModelName, data, requestOptions); + Response response = openAIServiceClient != null + ? this.openAIServiceClient.getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, data, + requestOptions) + : this.serviceClient.getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, data, + requestOptions); return new SimpleResponse<>(response, response.getValue().toString()); } /** * 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 - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     file: byte[] (Required)
@@ -1227,9 +1199,9 @@ public Response getAudioTranslationTextWithResponse(
      *     model: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     text: String (Required)
@@ -1256,7 +1228,7 @@ public Response getAudioTranslationTextWithResponse(
      * }
* * @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. + * (when using non-Azure OpenAI) to use for this request. * @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. @@ -1267,20 +1239,20 @@ public Response getAudioTranslationTextWithResponse( */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response getAudioTranscriptionAsResponseObjectWithResponse( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + Response getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName, + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation // 'getAudioTranscriptionAsResponseObject' is 'multipart/form-data' - return this.serviceClient.getAudioTranscriptionAsResponseObjectWithResponse( - deploymentOrModelName, audioTranscriptionOptions, requestOptions); + return this.serviceClient.getAudioTranscriptionAsResponseObjectWithResponse(deploymentOrModelName, + audioTranscriptionOptions, requestOptions); } /** * Gets transcribed text and associated metadata from provided spoken audio data. Audio will be transcribed in the * written language corresponding to the language it was spoken in. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     file: byte[] (Required)
@@ -1291,15 +1263,15 @@ Response getAudioTranscriptionAsResponseObjectWithResponse(
      *     model: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * 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. + * (when using non-Azure OpenAI) to use for this request. * @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. @@ -1310,17 +1282,17 @@ Response getAudioTranscriptionAsResponseObjectWithResponse( */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranscriptionAsPlainTextWithResponse( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { - return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponse( - deploymentOrModelName, audioTranscriptionOptions, requestOptions); + public Response getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, + audioTranscriptionOptions, requestOptions); } /** * Gets English language transcribed text and associated metadata from provided spoken audio data. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     file: byte[] (Required)
@@ -1330,9 +1302,9 @@ public Response getAudioTranscriptionAsPlainTextWithResponse(
      *     model: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     text: String (Required)
@@ -1359,7 +1331,7 @@ public Response getAudioTranscriptionAsPlainTextWithResponse(
      * }
* * @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. + * (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. @@ -1367,23 +1339,23 @@ public Response getAudioTranscriptionAsPlainTextWithResponse( * @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}. + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response getAudioTranslationAsResponseObjectWithResponse( - String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { + Response getAudioTranslationAsResponseObjectWithResponse(String deploymentOrModelName, + BinaryData audioTranslationOptions, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation // 'getAudioTranslationAsResponseObject' is 'multipart/form-data' - return this.serviceClient.getAudioTranslationAsResponseObjectWithResponse( - deploymentOrModelName, audioTranslationOptions, requestOptions); + return this.serviceClient.getAudioTranslationAsResponseObjectWithResponse(deploymentOrModelName, + audioTranslationOptions, requestOptions); } /** * Gets English language transcribed text and associated metadata from provided spoken audio data. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     file: byte[] (Required)
@@ -1393,15 +1365,15 @@ Response getAudioTranslationAsResponseObjectWithResponse(
      *     model: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * 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. + * (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. @@ -1409,14 +1381,14 @@ Response getAudioTranslationAsResponseObjectWithResponse( * @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}. + * {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranslationAsPlainTextWithResponse( - String deploymentOrModelName, BinaryData audioTranslationOptions, RequestOptions requestOptions) { - return this.serviceClient.getAudioTranslationAsPlainTextWithResponse( - deploymentOrModelName, audioTranslationOptions, requestOptions); + public Response getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, + BinaryData audioTranslationOptions, RequestOptions requestOptions) { + return this.serviceClient.getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, + audioTranslationOptions, requestOptions); } /** @@ -1424,7 +1396,7 @@ public Response getAudioTranslationAsPlainTextWithResponse( * written language corresponding to the language it was spoken in. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param audioTranscriptionOptions The configuration information for an audio transcription request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1436,21 +1408,19 @@ public Response getAudioTranslationAsPlainTextWithResponse( */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public String getAudioTranscriptionAsPlainText( - String deploymentOrModelName, AudioTranscriptionOptions audioTranscriptionOptions) { + public String getAudioTranscriptionAsPlainText(String deploymentOrModelName, + AudioTranscriptionOptions audioTranscriptionOptions) { // Generated convenience method for getAudioTranscriptionAsPlainTextWithResponse RequestOptions requestOptions = new RequestOptions(); - return getAudioTranscriptionAsPlainTextWithResponse( - deploymentOrModelName, BinaryData.fromObject(audioTranscriptionOptions), requestOptions) - .getValue() - .toObject(String.class); + return getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, + BinaryData.fromObject(audioTranscriptionOptions), requestOptions).getValue().toObject(String.class); } /** * Gets English language transcribed text and associated metadata from provided spoken audio data. * * @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. + * (when using non-Azure OpenAI) to use for this request. * @param audioTranslationOptions The configuration information for an audio translation request. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1462,13 +1432,64 @@ public String getAudioTranscriptionAsPlainText( */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public String getAudioTranslationAsPlainText( - String deploymentOrModelName, AudioTranslationOptions audioTranslationOptions) { + public String getAudioTranslationAsPlainText(String deploymentOrModelName, + AudioTranslationOptions audioTranslationOptions) { // Generated convenience method for getAudioTranslationAsPlainTextWithResponse RequestOptions requestOptions = new RequestOptions(); - return getAudioTranslationAsPlainTextWithResponse( - deploymentOrModelName, BinaryData.fromObject(audioTranslationOptions), requestOptions) - .getValue() - .toObject(String.class); + return getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, + BinaryData.fromObject(audioTranslationOptions), requestOptions).getValue().toObject(String.class); + } + + /** + * 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. + * + * @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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + ChatCompletions getChatCompletionsWithAzureExtensions(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions) { + // Generated convenience method for getChatCompletionsWithAzureExtensionsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName, + BinaryData.fromObject(chatCompletionsOptions), requestOptions).getValue().toObject(ChatCompletions.class); + } + + /** + * Starts the generation of a batch of images from a text caption. + * + * @param imageGenerationOptions Represents the request data used to generate images. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of a polling status update or final response payload for an image + * operation. + */ + @Generated + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller + beginBeginAzureBatchImageGeneration(ImageGenerationOptions imageGenerationOptions) { + // Generated convenience method for beginBeginAzureBatchImageGenerationWithModel + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.beginBeginAzureBatchImageGenerationWithModel(BinaryData.fromObject(imageGenerationOptions), + requestOptions); } } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java index 4ec8a75131c2..2ab76b509fc2 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIClientBuilder.java @@ -46,28 +46,32 @@ import java.util.Map; import java.util.Objects; -/** A builder for creating a new instance of the OpenAIClient type. */ -@ServiceClientBuilder(serviceClients = {OpenAIClient.class, OpenAIAsyncClient.class}) -public final class OpenAIClientBuilder - implements HttpTrait, - ConfigurationTrait, - TokenCredentialTrait, - KeyCredentialTrait, - EndpointTrait { +/** + * A builder for creating a new instance of the OpenAIClient type. + */ +@ServiceClientBuilder(serviceClients = { OpenAIClient.class, OpenAIAsyncClient.class }) +public final class OpenAIClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { - @Generated private static final String SDK_NAME = "name"; + @Generated + private static final String SDK_NAME = "name"; - @Generated private static final String SDK_VERSION = "version"; + @Generated + private static final String SDK_VERSION = "version"; @Generated - private static final String[] DEFAULT_SCOPES = new String[] {"https://cognitiveservices.azure.com/.default"}; + private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" }; @Generated private static final Map PROPERTIES = CoreUtils.getProperties("azure-ai-openai.properties"); - @Generated private final List pipelinePolicies; + @Generated + private final List pipelinePolicies; - /** Create an instance of the OpenAIClientBuilder. */ + /** + * Create an instance of the OpenAIClientBuilder. + */ @Generated public OpenAIClientBuilder() { this.pipelinePolicies = new ArrayList<>(); @@ -76,9 +80,12 @@ public OpenAIClientBuilder() { /* * The HTTP pipeline to send requests through. */ - @Generated private HttpPipeline pipeline; + @Generated + private HttpPipeline pipeline; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder pipeline(HttpPipeline pipeline) { @@ -92,9 +99,12 @@ public OpenAIClientBuilder pipeline(HttpPipeline pipeline) { /* * The HTTP client used to send the request. */ - @Generated private HttpClient httpClient; + @Generated + private HttpClient httpClient; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder httpClient(HttpClient httpClient) { @@ -105,9 +115,12 @@ public OpenAIClientBuilder httpClient(HttpClient httpClient) { /* * The logging configuration for HTTP requests and responses. */ - @Generated private HttpLogOptions httpLogOptions; + @Generated + private HttpLogOptions httpLogOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { @@ -118,9 +131,12 @@ public OpenAIClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { /* * The client options such as application ID and custom headers to set on a request. */ - @Generated private ClientOptions clientOptions; + @Generated + private ClientOptions clientOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder clientOptions(ClientOptions clientOptions) { @@ -131,9 +147,12 @@ public OpenAIClientBuilder clientOptions(ClientOptions clientOptions) { /* * The retry options to configure retry policy for failed requests. */ - @Generated private RetryOptions retryOptions; + @Generated + private RetryOptions retryOptions; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder retryOptions(RetryOptions retryOptions) { @@ -141,7 +160,9 @@ public OpenAIClientBuilder retryOptions(RetryOptions retryOptions) { return this; } - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { @@ -153,9 +174,12 @@ public OpenAIClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { /* * The configuration store that is used during construction of the service client. */ - @Generated private Configuration configuration; + @Generated + private Configuration configuration; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder configuration(Configuration configuration) { @@ -166,9 +190,12 @@ public OpenAIClientBuilder configuration(Configuration configuration) { /* * The TokenCredential used for authentication. */ - @Generated private TokenCredential tokenCredential; + @Generated + private TokenCredential tokenCredential; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder credential(TokenCredential tokenCredential) { @@ -176,10 +203,14 @@ public OpenAIClientBuilder credential(TokenCredential tokenCredential) { return this; } - /** The KeyCredential used for OpenAi authentication. It could be either of Azure or Non-Azure OpenAI API key. */ + /** + * The KeyCredential used for OpenAi authentication. It could be either of Azure or Non-Azure OpenAI API key. + */ private KeyCredential keyCredential; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder credential(KeyCredential keyCredential) { @@ -190,9 +221,12 @@ public OpenAIClientBuilder credential(KeyCredential keyCredential) { /* * The service endpoint */ - @Generated private String endpoint; + @Generated + private String endpoint; - /** {@inheritDoc}. */ + /** + * {@inheritDoc}. + */ @Generated @Override public OpenAIClientBuilder endpoint(String endpoint) { @@ -203,7 +237,8 @@ public OpenAIClientBuilder endpoint(String endpoint) { /* * Service version */ - @Generated private OpenAIServiceVersion serviceVersion; + @Generated + private OpenAIServiceVersion serviceVersion; /** * Sets Service version. @@ -220,7 +255,8 @@ public OpenAIClientBuilder serviceVersion(OpenAIServiceVersion serviceVersion) { /* * The retry policy that will attempt to retry failed requests, if applicable. */ - @Generated private RetryPolicy retryPolicy; + @Generated + private RetryPolicy retryPolicy; /** * Sets The retry policy that will attempt to retry failed requests, if applicable. @@ -242,20 +278,16 @@ public OpenAIClientBuilder retryPolicy(RetryPolicy retryPolicy) { @Generated private OpenAIClientImpl buildInnerClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - OpenAIServiceVersion localServiceVersion = - (serviceVersion != null) ? serviceVersion : OpenAIServiceVersion.getLatest(); - OpenAIClientImpl client = - new OpenAIClientImpl( - localPipeline, - JacksonAdapter.createDefaultSerializerAdapter(), - this.endpoint, - localServiceVersion); + OpenAIServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : OpenAIServiceVersion.getLatest(); + OpenAIClientImpl client = new OpenAIClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), + this.endpoint, localServiceVersion); return client; } private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; List policies = new ArrayList<>(); @@ -270,40 +302,32 @@ private HttpPipeline createHttpPipeline() { if (headers.getSize() > 0) { policies.add(new AddHeadersPolicy(headers)); } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .forEach(p -> policies.add(p)); + this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); policies.add(new AddDatePolicy()); policies.add(new CookiePolicy()); if (keyCredential != null) { - policies.add( - useNonAzureOpenAIService() - ? new KeyCredentialPolicy("Authorization", keyCredential, "Bearer") - : new KeyCredentialPolicy("api-key", keyCredential)); + policies.add(useNonAzureOpenAIService() ? new KeyCredentialPolicy("Authorization", keyCredential, "Bearer") + : new KeyCredentialPolicy("api-key", keyCredential)); } if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); } - this.pipelinePolicies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .forEach(p -> policies.add(p)); + this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .clientOptions(localClientOptions) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient).clientOptions(localClientOptions).build(); return httpPipeline; } private NonAzureOpenAIClientImpl buildInnerNonAzureOpenAIClient() { HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); - NonAzureOpenAIClientImpl client = - new NonAzureOpenAIClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); + NonAzureOpenAIClientImpl client + = new NonAzureOpenAIClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter()); return client; } @@ -313,9 +337,8 @@ private NonAzureOpenAIClientImpl buildInnerNonAzureOpenAIClient() { * @return an instance of OpenAIAsyncClient. */ public OpenAIAsyncClient buildAsyncClient() { - return useNonAzureOpenAIService() - ? new OpenAIAsyncClient(buildInnerNonAzureOpenAIClient()) - : new OpenAIAsyncClient(buildInnerClient()); + return useNonAzureOpenAIService() ? new OpenAIAsyncClient(buildInnerNonAzureOpenAIClient()) + : new OpenAIAsyncClient(buildInnerClient()); } /** @@ -324,9 +347,8 @@ public OpenAIAsyncClient buildAsyncClient() { * @return an instance of OpenAIClient. */ public OpenAIClient buildClient() { - return useNonAzureOpenAIService() - ? new OpenAIClient(buildInnerNonAzureOpenAIClient()) - : new OpenAIClient(buildInnerClient()); + return useNonAzureOpenAIService() ? new OpenAIClient(buildInnerNonAzureOpenAIClient()) + : new OpenAIClient(buildInnerClient()); } private static final ClientLogger LOGGER = new ClientLogger(OpenAIClientBuilder.class); diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIServiceVersion.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIServiceVersion.java index 19923a82e45b..6ba5e78bef59 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIServiceVersion.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/OpenAIServiceVersion.java @@ -6,24 +6,38 @@ import com.azure.core.util.ServiceVersion; -/** Service version of OpenAIClient. */ +/** + * Service version of OpenAIClient. + */ public enum OpenAIServiceVersion implements ServiceVersion { - /** Enum value 2022-12-01. */ + /** + * Enum value 2022-12-01. + */ V2022_12_01("2022-12-01"), - /** Enum value 2023-05-15. */ + /** + * Enum value 2023-05-15. + */ V2023_05_15("2023-05-15"), - /** Enum value 2023-06-01-preview. */ + /** + * Enum value 2023-06-01-preview. + */ V2023_06_01_PREVIEW("2023-06-01-preview"), - /** Enum value 2023-07-01-preview. */ + /** + * Enum value 2023-07-01-preview. + */ V2023_07_01_PREVIEW("2023-07-01-preview"), - /** Enum value 2023-08-01-preview. */ + /** + * Enum value 2023-08-01-preview. + */ V2023_08_01_PREVIEW("2023-08-01-preview"), - /** Enum value 2023-09-01-preview. */ + /** + * Enum value 2023-09-01-preview. + */ V2023_09_01_PREVIEW("2023-09-01-preview"); private final String version; @@ -32,7 +46,9 @@ public enum OpenAIServiceVersion implements ServiceVersion { this.version = version; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public String getVersion() { return this.version; @@ -40,7 +56,7 @@ public String getVersion() { /** * Gets the latest service version supported by this client library. - * + * * @return The latest {@link OpenAIServiceVersion}. */ public static OpenAIServiceVersion getLatest() { 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..432a05065e11 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 @@ -5,6 +5,7 @@ package com.azure.ai.openai.implementation; import com.azure.ai.openai.OpenAIServiceVersion; +import com.azure.ai.openai.implementation.models.BatchImageGenerationOperationResponse; import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.ExpectedResponses; import com.azure.core.annotation.HeaderParam; @@ -42,9 +43,13 @@ import java.time.Duration; import reactor.core.publisher.Mono; -/** Initializes a new instance of the OpenAIClient type. */ +/** + * Initializes a new instance of the OpenAIClient type. + */ public final class OpenAIClientImpl { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OpenAIClientService service; /** @@ -56,43 +61,49 @@ public final class OpenAIClientImpl { /** * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: * https://westus.api.cognitive.microsoft.com). - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Service version. */ + /** + * Service version. + */ private final OpenAIServiceVersion serviceVersion; /** * Gets Service version. - * + * * @return the serviceVersion value. */ public OpenAIServiceVersion getServiceVersion() { return this.serviceVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { @@ -101,25 +112,22 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of OpenAIClient client. - * + * * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: - * https://westus.api.cognitive.microsoft.com). + * https://westus.api.cognitive.microsoft.com). * @param serviceVersion Service version. */ public OpenAIClientImpl(String endpoint, OpenAIServiceVersion serviceVersion) { - this( - new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), - endpoint, - serviceVersion); + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of OpenAIClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: - * https://westus.api.cognitive.microsoft.com). + * https://westus.api.cognitive.microsoft.com). * @param serviceVersion Service version. */ public OpenAIClientImpl(HttpPipeline httpPipeline, String endpoint, OpenAIServiceVersion serviceVersion) { @@ -128,18 +136,15 @@ public OpenAIClientImpl(HttpPipeline httpPipeline, String endpoint, OpenAIServic /** * Initializes an instance of OpenAIClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: - * https://westus.api.cognitive.microsoft.com). + * https://westus.api.cognitive.microsoft.com). * @param serviceVersion Service version. */ - public OpenAIClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - String endpoint, - OpenAIServiceVersion serviceVersion) { + public OpenAIClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + OpenAIServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; @@ -153,692 +158,804 @@ public OpenAIClientImpl( @Host("{endpoint}/openai") @ServiceInterface(name = "OpenAIClient") public interface OpenAIClientService { - @Post("/deployments/{deploymentId}/embeddings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/audio/transcriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getEmbeddings( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData embeddingsOptions, - RequestOptions requestOptions, - Context context); + Mono> getAudioTranscriptionAsPlainText(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData audioTranscriptionOptions, + RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/embeddings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/audio/transcriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getEmbeddingsSync( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData embeddingsOptions, - RequestOptions requestOptions, - Context context); + Response getAudioTranscriptionAsPlainTextSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData audioTranscriptionOptions, + RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/completions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + // @Multipart not supported by RestProxy + @Post("/deployments/{deploymentId}/audio/transcriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getCompletions( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData completionsOptions, - RequestOptions requestOptions, - Context context); + 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("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, + Context context); - @Post("/deployments/{deploymentId}/completions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + // @Multipart not supported by RestProxy + @Post("/deployments/{deploymentId}/audio/transcriptions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getCompletionsSync( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData completionsOptions, - RequestOptions requestOptions, - Context context); + 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("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, + Context context); - @Post("/deployments/{deploymentId}/chat/completions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/audio/translations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getChatCompletions( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData chatCompletionsOptions, - RequestOptions requestOptions, - Context context); + Mono> getAudioTranslationAsPlainText(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData audioTranslationOptions, + RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/chat/completions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/audio/translations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getChatCompletionsSync( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData chatCompletionsOptions, - RequestOptions requestOptions, - Context context); + Response getAudioTranslationAsPlainTextSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData audioTranslationOptions, + RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/extensions/chat/completions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + // @Multipart not supported by RestProxy + @Post("/deployments/{deploymentId}/audio/translations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getChatCompletionsWithAzureExtensions( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData chatCompletionsOptions, - RequestOptions requestOptions, - Context context); + 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("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, + Context context); - @Post("/deployments/{deploymentId}/extensions/chat/completions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + // @Multipart not supported by RestProxy + @Post("/deployments/{deploymentId}/audio/translations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getChatCompletionsWithAzureExtensionsSync( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData chatCompletionsOptions, - RequestOptions requestOptions, - Context context); + 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("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, + Context context); - @Post("/images/generations:submit") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/completions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> beginAzureBatchImageGeneration( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData imageGenerationOptions, - RequestOptions requestOptions, - Context context); + Mono> getCompletions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions, + RequestOptions requestOptions, Context context); - @Post("/images/generations:submit") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/completions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response beginAzureBatchImageGenerationSync( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData imageGenerationOptions, - RequestOptions requestOptions, - Context context); + Response getCompletionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions, + RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/audio/transcriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/chat/completions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAudioTranscriptionAsPlainText( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData audioTranscriptionOptions, - RequestOptions requestOptions, - Context context); + Mono> getChatCompletions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, + RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/audio/transcriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/chat/completions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAudioTranscriptionAsPlainTextSync( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData audioTranscriptionOptions, - RequestOptions requestOptions, - Context context); + Response getChatCompletionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, + RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy - @Post("/deployments/{deploymentId}/audio/transcriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/extensions/chat/completions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - 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("multipart/form-data") BinaryData audioTranscriptionOptions, - RequestOptions requestOptions, - Context context); + Mono> getChatCompletionsWithAzureExtensions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, + RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy - @Post("/deployments/{deploymentId}/audio/transcriptions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/extensions/chat/completions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - 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("multipart/form-data") BinaryData audioTranscriptionOptions, - RequestOptions requestOptions, - Context context); + Response getChatCompletionsWithAzureExtensionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, + RequestOptions requestOptions, Context context); - @Post("/deployments/{deploymentId}/audio/translations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/images/generations:submit") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getAudioTranslationAsPlainText( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData audioTranslationOptions, - RequestOptions requestOptions, - Context context); + Mono> beginAzureBatchImageGeneration(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, + Context context); - @Post("/deployments/{deploymentId}/audio/translations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/images/generations:submit") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getAudioTranslationAsPlainTextSync( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, - @BodyParam("application/json") BinaryData audioTranslationOptions, - RequestOptions requestOptions, - Context context); + Response beginAzureBatchImageGenerationSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("accept") String accept, + @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, + Context context); - // @Multipart not supported by RestProxy - @Post("/deployments/{deploymentId}/audio/translations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/embeddings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - 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("multipart/form-data") BinaryData audioTranslationOptions, - RequestOptions requestOptions, - Context context); + Mono> getEmbeddings(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, + RequestOptions requestOptions, Context context); - // @Multipart not supported by RestProxy - @Post("/deployments/{deploymentId}/audio/translations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType( - value = ClientAuthenticationException.class, - code = {401}) - @UnexpectedResponseExceptionType( - value = ResourceNotFoundException.class, - code = {404}) - @UnexpectedResponseExceptionType( - value = ResourceModifiedException.class, - code = {409}) + @Post("/deployments/{deploymentId}/embeddings") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - 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("multipart/form-data") BinaryData audioTranslationOptions, - RequestOptions requestOptions, - Context context); + Response getEmbeddingsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, + RequestOptions requestOptions, Context context); } /** - * Return the embeddings for a given prompt. - * - *

Request Body Schema - * + * 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 - * + *

+ * 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. + * (when using non-Azure OpenAI) to use for this request. + * @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( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - embeddingsOptions, - requestOptions, - context)); + return FluxUtil.withContext(context -> service.getAudioTranscriptionAsPlainText(this.getEndpoint(), + this.getServiceVersion().getVersion(), deploymentOrModelName, accept, audioTranscriptionOptions, + requestOptions, context)); } /** - * Return the embeddings for a given prompt. - * - *

Request Body Schema - * + * 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 - * + *

+ * 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. + * (when using non-Azure OpenAI) to use for this request. + * @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( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - embeddingsOptions, - requestOptions, - Context.NONE); + return service.getAudioTranscriptionAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, 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. - * - *

Request Body Schema - * + * 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)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@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. + * (when using non-Azure OpenAI) to use for this request. + * @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( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - completionsOptions, - requestOptions, - context)); + return FluxUtil.withContext(context -> service.getAudioTranscriptionAsResponseObject(this.getEndpoint(), + this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, + 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. - * - *

Request Body Schema - * + * 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)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@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): {
+     *             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)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName, + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.getAudioTranscriptionAsResponseObjectSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, + audioTranscriptionOptions, requestOptions, Context.NONE); + } + + /** + * Gets English language transcribed text and associated metadata from provided spoken audio data. + *

+ * 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)
+     * }
+     * }
+ *

+ * Response Body Schema + *

+ *
{@code
+     * 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 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} on successful completion of {@link Mono}. + */ + @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)); + } + + /** + * Gets English language transcribed text and associated metadata from provided spoken audio data. + *

+ * 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)
+     * }
+     * }
+ *

+ * Response Body Schema + *

+ *
{@code
+     * 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 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 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); + } + + /** + * Gets English language transcribed text and associated metadata from provided spoken audio data. + *

+ * 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)
+     * }
+     * }
+ *

+ * Response Body Schema + *

+ *
{@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)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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} 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"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getAudioTranslationAsResponseObject(this.getEndpoint(), + this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranslationOptions, + requestOptions, context)); + } + + /** + * Gets English language transcribed text and associated metadata from provided spoken audio data. + *

+ * 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)
+     * }
+     * }
+ *

+ * Response Body Schema + *

+ *
{@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)
+     *         }
+     *     ]
+     * }
+     * }
+ * + * @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)
+     *     logit_bias (Optional): {
+     *         String: int (Optional)
+     *     }
+     *     user: String (Optional)
+     *     n: Integer (Optional)
+     *     logprobs: Integer (Optional)
+     *     echo: Boolean (Optional)
+     *     stop (Optional): [
+     *         String (Optional)
+     *     ]
+     *     presence_penalty: Double (Optional)
+     *     frequency_penalty: Double (Optional)
+     *     best_of: Integer (Optional)
+     *     stream: Boolean (Optional)
+     *     model: String (Optional)
+     * }
+     * }
+ *

+ * Response Body Schema + *

+ *
{@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)
+     *             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 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 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 Mono> getCompletionsWithResponseAsync(String deploymentOrModelName, + BinaryData completionsOptions, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, completionsOptions, 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. + *

+ * Request Body Schema + *

+ *
{@code
+     * {
+     *     prompt (Required): [
+     *         String (Required)
+     *     ]
+     *     max_tokens: Integer (Optional)
+     *     temperature: Double (Optional)
+     *     top_p: Double (Optional)
+     *     logit_bias (Optional): {
+     *         String: int (Optional)
+     *     }
+     *     user: String (Optional)
+     *     n: Integer (Optional)
+     *     logprobs: Integer (Optional)
+     *     echo: Boolean (Optional)
+     *     stop (Optional): [
+     *         String (Optional)
+     *     ]
+     *     presence_penalty: Double (Optional)
+     *     frequency_penalty: Double (Optional)
+     *     best_of: Integer (Optional)
+     *     stream: Boolean (Optional)
+     *     model: String (Optional)
+     * }
+     * }
+ *

+ * Response Body Schema + *

+ *
{@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)
@@ -884,39 +1001,36 @@ public Mono> getCompletionsWithResponseAsync(
      *     }
      * }
      * }
- * + * * @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. + * (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 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 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) - public Response getCompletionsWithResponse( - String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { + public Response getCompletionsWithResponse(String deploymentOrModelName, BinaryData completionsOptions, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.getCompletionsSync( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - completionsOptions, - requestOptions, - Context.NONE); + return service.getCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, completionsOptions, 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. - * - *

Request Body Schema - * + * 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
      * {
      *     messages (Required): [
@@ -942,7 +1056,7 @@ public Response getCompletionsWithResponse(
      *             parameters: Object (Optional)
      *         }
      *     ]
-     *     function_call: FunctionCallModelBase (Optional)
+     *     function_call: BinaryData (Optional)
      *     max_tokens: Integer (Optional)
      *     temperature: Double (Optional)
      *     top_p: Double (Optional)
@@ -966,9 +1080,9 @@ public Response getCompletionsWithResponse(
      *     ]
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -1028,42 +1142,37 @@ public Response getCompletionsWithResponse(
      *     }
      * }
      * }
- * + * * @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. + * (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 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 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.SINGLE) - public Mono> getChatCompletionsWithResponseAsync( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + 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)); + context -> service.getChatCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, chatCompletionsOptions, 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. - * - *

Request Body Schema - * + * 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
      * {
      *     messages (Required): [
@@ -1089,7 +1198,7 @@ public Mono> getChatCompletionsWithResponseAsync(
      *             parameters: Object (Optional)
      *         }
      *     ]
-     *     function_call: FunctionCallModelBase (Optional)
+     *     function_call: BinaryData (Optional)
      *     max_tokens: Integer (Optional)
      *     temperature: Double (Optional)
      *     top_p: Double (Optional)
@@ -1113,9 +1222,9 @@ public Mono> getChatCompletionsWithResponseAsync(
      *     ]
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -1175,40 +1284,36 @@ public Mono> getChatCompletionsWithResponseAsync(
      *     }
      * }
      * }
- * + * * @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. + * (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 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 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.SINGLE) - public Response getChatCompletionsWithResponse( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + 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); + return service.getChatCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, chatCompletionsOptions, 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. - * - *

Request Body Schema - * + * 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
      * {
      *     messages (Required): [
@@ -1234,7 +1339,7 @@ public Response getChatCompletionsWithResponse(
      *             parameters: Object (Optional)
      *         }
      *     ]
-     *     function_call: FunctionCallModelBase (Optional)
+     *     function_call: BinaryData (Optional)
      *     max_tokens: Integer (Optional)
      *     temperature: Double (Optional)
      *     top_p: Double (Optional)
@@ -1258,9 +1363,9 @@ public Response getChatCompletionsWithResponse(
      *     ]
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -1320,43 +1425,38 @@ public Response getChatCompletionsWithResponse(
      *     }
      * }
      * }
- * + * * @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. + * (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 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 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> getChatCompletionsWithAzureExtensionsWithResponseAsync( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getChatCompletionsWithAzureExtensions( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - chatCompletionsOptions, - requestOptions, - context)); + return FluxUtil.withContext(context -> service.getChatCompletionsWithAzureExtensions(this.getEndpoint(), + this.getServiceVersion().getVersion(), deploymentOrModelName, accept, chatCompletionsOptions, + 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. - * - *

Request Body Schema - * + * 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
      * {
      *     messages (Required): [
@@ -1382,7 +1482,7 @@ public Mono> getChatCompletionsWithAzureExtensionsWithRespo
      *             parameters: Object (Optional)
      *         }
      *     ]
-     *     function_call: FunctionCallModelBase (Optional)
+     *     function_call: BinaryData (Optional)
      *     max_tokens: Integer (Optional)
      *     temperature: Double (Optional)
      *     top_p: Double (Optional)
@@ -1406,9 +1506,9 @@ public Mono> getChatCompletionsWithAzureExtensionsWithRespo
      *     ]
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -1468,39 +1568,35 @@ 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. + * (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 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 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 getChatCompletionsWithAzureExtensionsWithResponse( - String deploymentOrModelName, BinaryData chatCompletionsOptions, RequestOptions requestOptions) { + public Response getChatCompletionsWithAzureExtensionsWithResponse(String deploymentOrModelName, + BinaryData chatCompletionsOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getChatCompletionsWithAzureExtensionsSync( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - chatCompletionsOptions, - requestOptions, - Context.NONE); + return service.getChatCompletionsWithAzureExtensionsSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), deploymentOrModelName, accept, chatCompletionsOptions, + requestOptions, Context.NONE); } /** * Starts the generation of a batch of images from a text caption. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     prompt: String (Required)
@@ -1510,9 +1606,9 @@ public Response getChatCompletionsWithAzureExtensionsWithResponse(
      *     user: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -1520,7 +1616,7 @@ public Response getChatCompletionsWithAzureExtensionsWithResponse(
      *     expires: Long (Optional)
      *     result (Optional): {
      *         created: long (Required)
-     *         data: DataModelBase (Required)
+     *         data: BinaryData (Required)
      *     }
      *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
      *     error (Optional): {
@@ -1537,7 +1633,7 @@ public Response getChatCompletionsWithAzureExtensionsWithResponse(
      *     }
      * }
      * }
- * + * * @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. @@ -1545,28 +1641,21 @@ public Response getChatCompletionsWithAzureExtensionsWithResponse( * @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}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> beginAzureBatchImageGenerationWithResponseAsync( - BinaryData imageGenerationOptions, RequestOptions requestOptions) { + BinaryData imageGenerationOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.beginAzureBatchImageGeneration( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - imageGenerationOptions, - requestOptions, - context)); + 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 - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     prompt: String (Required)
@@ -1576,9 +1665,9 @@ private Mono> beginAzureBatchImageGenerationWithResponseAsy
      *     user: String (Optional)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@code
      * {
      *     id: String (Required)
@@ -1586,7 +1675,7 @@ private Mono> beginAzureBatchImageGenerationWithResponseAsy
      *     expires: Long (Optional)
      *     result (Optional): {
      *         created: long (Required)
-     *         data: DataModelBase (Required)
+     *         data: BinaryData (Required)
      *     }
      *     status: String(notRunning/running/succeeded/canceled/failed) (Required)
      *     error (Optional): {
@@ -1603,7 +1692,7 @@ private Mono> beginAzureBatchImageGenerationWithResponseAsy
      *     }
      * }
      * }
- * + * * @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. @@ -1613,92 +1702,18 @@ private Mono> beginAzureBatchImageGenerationWithResponseAsy * @return a polling status update or final response payload for an image operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Response beginAzureBatchImageGenerationWithResponse( - BinaryData imageGenerationOptions, RequestOptions requestOptions) { + private Response beginAzureBatchImageGenerationWithResponse(BinaryData imageGenerationOptions, + RequestOptions requestOptions) { final String accept = "application/json"; - return service.beginAzureBatchImageGenerationSync( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - accept, - imageGenerationOptions, - requestOptions, - Context.NONE); - } - - /** - * 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)
-     * }
-     * }
- * - *

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)
-     *         }
-     *     }
-     * }
-     * }
- * - * @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 the {@link PollerFlux} for polling of a polling status update or final response payload for an image - * operation. - */ - @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)); + return service.beginAzureBatchImageGenerationSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, imageGenerationOptions, requestOptions, Context.NONE); } /** * Starts the generation of a batch of images from a text caption. - * - *

Request Body Schema - * + *

+ * Request Body Schema + *

*
{@code
      * {
      *     prompt: String (Required)
@@ -1708,532 +1723,362 @@ public PollerFlux beginBeginAzureBatchImageGenerationAsy
      *     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)
-     *         }
-     *     }
-     * }
-     * }
- * - * @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 the {@link SyncPoller} for polling of a polling status update or final response payload for an image - * operation. - */ - @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 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
-     * {
-     *     file: byte[] (Required)
-     *     response_format: String(json/verbose_json/text/srt/vtt) (Optional)
-     *     language: String (Optional)
-     *     prompt: String (Optional)
-     *     temperature: Double (Optional)
-     *     model: String (Optional)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * 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 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 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> getAudioTranscriptionAsPlainTextWithResponseAsync( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getAudioTranscriptionAsPlainText( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - audioTranscriptionOptions, - 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. - * - *

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)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@code
-     * 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 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 transcribed text and associated metadata from provided spoken audio data along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranscriptionAsPlainTextWithResponse( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.getAudioTranscriptionAsPlainTextSync( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - accept, - audioTranscriptionOptions, - 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. - * - *

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)
-     * }
-     * }
- * - *

Response Body Schema - * - *

{@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)
+     * 

+ * Response Body Schema + *

+ *
{@code
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     expires: Long (Optional)
+     *     result (Optional): {
+     *         created: long (Required)
+     *         data: BinaryData (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 - * 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> getAudioTranscriptionAsResponseObjectWithResponseAsync( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.getAudioTranscriptionAsResponseObject( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - contentType, - accept, - audioTranscriptionOptions, - 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 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 - * + * 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)
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@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: BinaryData (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 the {@link SyncPoller} for polling of a polling status update or final response payload for an image + * operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAudioTranscriptionAsResponseObjectWithResponse( - String deploymentOrModelName, BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { - final String contentType = "multipart/form-data"; - final String accept = "application/json"; - return service.getAudioTranscriptionAsResponseObjectSync( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - contentType, - accept, - audioTranscriptionOptions, - 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. - * - *

Request Body Schema - * + * 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 - * + *

+ * Response Body Schema + *

*
{@code
-     * String
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     expires: Long (Optional)
+     *     result (Optional): {
+     *         created: long (Required)
+     *         data: BinaryData (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 + beginBeginAzureBatchImageGenerationWithModelAsync(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(BatchImageGenerationOperationResponse.class), + TypeReference.createInstance(BatchImageGenerationOperationResponse.class)); } /** - * Gets English language transcribed text and associated metadata from provided spoken audio data. - * - *

Request Body Schema - * + * 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 - * + *

+ * Response Body Schema + *

*
{@code
-     * String
+     * {
+     *     id: String (Required)
+     *     created: long (Required)
+     *     expires: Long (Optional)
+     *     result (Optional): {
+     *         created: long (Required)
+     *         data: BinaryData (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 + beginBeginAzureBatchImageGenerationWithModel(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(BatchImageGenerationOperationResponse.class), + TypeReference.createInstance(BatchImageGenerationOperationResponse.class)); } /** - * Gets English language transcribed text and associated metadata from provided spoken audio data. - * - *

Request Body Schema - * + * 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)
+     *     ]
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@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. + * (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 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( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - contentType, - accept, - audioTranslationOptions, - requestOptions, - context)); + return FluxUtil + .withContext(context -> service.getEmbeddings(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, embeddingsOptions, requestOptions, context)); } /** - * Gets English language transcribed text and associated metadata from provided spoken audio data. - * - *

Request Body Schema - * + * 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)
+     *     ]
      * }
      * }
- * - *

Response Body Schema - * + *

+ * Response Body Schema + *

*
{@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. + * (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 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( - this.getEndpoint(), - this.getServiceVersion().getVersion(), - deploymentOrModelName, - contentType, - accept, - audioTranslationOptions, - requestOptions, - Context.NONE); + return service.getEmbeddingsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, 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..f3d12327d287 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/BatchImageGenerationOperationResponse.java @@ -0,0 +1,147 @@ +// 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/FunctionCallModelBase.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallModelBase.java deleted file mode 100644 index 622d71a15629..000000000000 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallModelBase.java +++ /dev/null @@ -1,11 +0,0 @@ -// 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 FunctionCallModelBase model. */ -public abstract class FunctionCallModelBase { - /** Creates an instance of FunctionCallModelBase class. */ - protected FunctionCallModelBase() {} -} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallPreset.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallPreset.java index 25620ebd3a49..ca6d625e6e30 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallPreset.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/FunctionCallPreset.java @@ -15,16 +15,18 @@ public final class FunctionCallPreset extends ExpandableStringEnum { /** - * Specifies that the model may either use any of the functions provided in this chat completions request or instead - * return a standard chat completions response as if no functions were provided. + * Specifies that the model may either use any of the functions provided in this chat completions request or + * instead return a standard chat completions response as if no functions were provided. */ - @Generated public static final FunctionCallPreset AUTO = fromString("auto"); + @Generated + public static final FunctionCallPreset AUTO = fromString("auto"); /** * Specifies that the model should not respond with a function call and should instead provide a standard chat * completions response. Response content may still be influenced by the provided function information. */ - @Generated public static final FunctionCallPreset NONE = fromString("none"); + @Generated + public static final FunctionCallPreset NONE = fromString("none"); /** * Creates a new instance of FunctionCallPreset value. @@ -33,7 +35,8 @@ public final class FunctionCallPreset 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/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..78d674b9cf8c --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageGenerations.java @@ -0,0 +1,73 @@ +// 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.azure.core.util.BinaryData; +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 BinaryData 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, BinaryData data) { + this.createdAt = createdAt.toEpochSecond(); + this.data = data; + } + + @Generated + @JsonCreator + private ImageGenerations(@JsonProperty(value = "created") long createdAt, + @JsonProperty(value = "data") BinaryData 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 BinaryData getData() { + return this.data; + } +} diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageLocation.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageLocation.java new file mode 100644 index 000000000000..cd7920f2b6c6 --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImageLocation.java @@ -0,0 +1,44 @@ +// 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 provides a URL from which an image may be accessed. + */ +@Immutable +public final class ImageLocation { + /* + * The URL that provides temporary access to download the generated image. + */ + @Generated + @JsonProperty(value = "url") + private String url; + + /** + * Creates an instance of ImageLocation class. + * + * @param url the url value to set. + */ + @Generated + @JsonCreator + public ImageLocation(@JsonProperty(value = "url") String url) { + this.url = url; + } + + /** + * Get the url property: The URL that provides temporary access to download the generated image. + * + * @return the url value. + */ + @Generated + public String getUrl() { + return this.url; + } +} 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..71d8aac11d3b --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/ImagePayload.java @@ -0,0 +1,44 @@ +// 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/package-info.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/implementation/models/package-info.java index b13d7b0f681e..3585ee66b780 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,7 @@ // 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 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..22408613bc5d 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,7 @@ // 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 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..e1c574edd29e 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; @@ -8,14 +8,22 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines the possible descriptors for available audio operation responses. */ +/** + * Defines the possible descriptors for available audio operation responses. + */ public final class AudioTaskLabel extends ExpandableStringEnum { - /** Accompanying response data resulted from an audio transcription task. */ - @Generated public static final AudioTaskLabel TRANSCRIBE = fromString("transcribe"); + /** + * Accompanying response data resulted from an audio transcription task. + */ + @Generated + public static final AudioTaskLabel TRANSCRIBE = fromString("transcribe"); - /** Accompanying response data resulted from an audio translation task. */ - @Generated public static final AudioTaskLabel TRANSLATE = fromString("translate"); + /** + * Accompanying response data resulted from an audio translation task. + */ + @Generated + public static final AudioTaskLabel TRANSLATE = fromString("translate"); /** * Creates a new instance of AudioTaskLabel value. @@ -24,7 +32,8 @@ public final class AudioTaskLabel extends ExpandableStringEnum { */ @Generated @Deprecated - public AudioTaskLabel() {} + public AudioTaskLabel() { + } /** * Creates or finds a AudioTaskLabel from its string representation. 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..f47f5d68a8ad 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; @@ -10,7 +10,9 @@ import java.time.Duration; import java.util.List; -/** Result information for an operation that transcribed spoken audio into written text. */ +/** + * Result information for an operation that transcribed spoken audio into written text. + */ @Immutable public final class AudioTranscription { @@ -82,8 +84,8 @@ public AudioTaskLabel getTask() { } /** - * Get the language property: The spoken language that was detected in the transcribed audio data. This is expressed - * as a two-letter ISO-639-1 language code like 'en' or 'fr'. + * Get the language property: The spoken language that was detected in the transcribed audio data. + * This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. * * @return the language value. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscriptionFormat.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscriptionFormat.java index 4f54dacfc28c..163e5deb4058 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscriptionFormat.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranscriptionFormat.java @@ -8,29 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines available options for the underlying response format of output transcription information. */ +/** + * Defines available options for the underlying response format of output transcription information. + */ public final class AudioTranscriptionFormat extends ExpandableStringEnum { - /** Use a response body that is a JSON object containing a single 'text' field for the transcription. */ - @Generated public static final AudioTranscriptionFormat JSON = fromString("json"); + /** + * Use a response body that is a JSON object containing a single 'text' field for the transcription. + */ + @Generated + public static final AudioTranscriptionFormat JSON = fromString("json"); /** * Use a response body that is a JSON object containing transcription text along with timing, segments, and other * metadata. */ - @Generated public static final AudioTranscriptionFormat VERBOSE_JSON = fromString("verbose_json"); + @Generated + public static final AudioTranscriptionFormat VERBOSE_JSON = fromString("verbose_json"); - /** Use a response body that is plain text containing the raw, unannotated transcription. */ - @Generated public static final AudioTranscriptionFormat TEXT = fromString("text"); + /** + * Use a response body that is plain text containing the raw, unannotated transcription. + */ + @Generated + public static final AudioTranscriptionFormat TEXT = fromString("text"); - /** Use a response body that is plain text in SubRip (SRT) format that also includes timing information. */ - @Generated public static final AudioTranscriptionFormat SRT = fromString("srt"); + /** + * Use a response body that is plain text in SubRip (SRT) format that also includes timing information. + */ + @Generated + public static final AudioTranscriptionFormat SRT = fromString("srt"); /** * Use a response body that is plain text in Web Video Text Tracks (VTT) format that also includes timing * information. */ - @Generated public static final AudioTranscriptionFormat VTT = fromString("vtt"); + @Generated + public static final AudioTranscriptionFormat VTT = fromString("vtt"); /** * Creates a new instance of AudioTranscriptionFormat value. @@ -39,7 +52,8 @@ public final class AudioTranscriptionFormat extends ExpandableStringEnum tokens, - int seek) { + private AudioTranscriptionSegment(int id, Duration start, Duration end, String text, double temperature, + double avgLogprob, double compressionRatio, double noSpeechProb, List tokens, int seek) { this.id = id; this.start = (double) start.toNanos() / 1000_000_000L; this.end = (double) end.toNanos() / 1000_000_000L; @@ -132,28 +125,14 @@ private AudioTranscriptionSegment( @Generated @JsonCreator - private AudioTranscriptionSegment( - @JsonProperty(value = "id") int id, - @JsonProperty(value = "start") double start, - @JsonProperty(value = "end") double end, - @JsonProperty(value = "text") String text, - @JsonProperty(value = "temperature") double temperature, - @JsonProperty(value = "avg_logprob") double avgLogprob, - @JsonProperty(value = "compression_ratio") double compressionRatio, - @JsonProperty(value = "no_speech_prob") double noSpeechProb, - @JsonProperty(value = "tokens") List tokens, - @JsonProperty(value = "seek") int seek) { - this( - id, - Duration.ofNanos((long) (start * 1000_000_000L)), - Duration.ofNanos((long) (end * 1000_000_000L)), - text, - temperature, - avgLogprob, - compressionRatio, - noSpeechProb, - tokens, - seek); + private AudioTranscriptionSegment(@JsonProperty(value = "id") int id, @JsonProperty(value = "start") double start, + @JsonProperty(value = "end") double end, @JsonProperty(value = "text") String text, + @JsonProperty(value = "temperature") double temperature, @JsonProperty(value = "avg_logprob") double avgLogprob, + @JsonProperty(value = "compression_ratio") double compressionRatio, + @JsonProperty(value = "no_speech_prob") double noSpeechProb, + @JsonProperty(value = "tokens") List tokens, @JsonProperty(value = "seek") int seek) { + this(id, Duration.ofNanos((long) (start * 1000_000_000L)), Duration.ofNanos((long) (end * 1000_000_000L)), text, + temperature, avgLogprob, compressionRatio, noSpeechProb, tokens, seek); } /** @@ -248,10 +227,12 @@ public List getTokens() { } /** - * Get the seek property: The seek position associated with the processing of this audio segment. Seek positions are - * expressed as hundredths of seconds. The model may process several segments from a single seek position, so while - * the seek position will never represent a later time than the segment's start, the segment's start may represent a - * significantly later time than the segment's associated seek position. + * Get the seek property: The seek position associated with the processing of this audio segment. + * Seek positions are expressed as hundredths of seconds. + * The model may process several segments from a single seek position, so while the seek position will never + * represent + * a later time than the segment's start, the segment's start may represent a significantly later time than the + * segment's associated seek position. * * @return the seek value. */ 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..f76e897fbc6a 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; @@ -10,7 +10,9 @@ import java.time.Duration; import java.util.List; -/** Result information for an operation that translated spoken audio into written text. */ +/** + * Result information for an operation that translated spoken audio into written text. + */ @Immutable public final class AudioTranslation { @@ -82,8 +84,8 @@ public AudioTaskLabel getTask() { } /** - * Get the language property: The spoken language that was detected in the translated audio data. This is expressed - * as a two-letter ISO-639-1 language code like 'en' or 'fr'. + * Get the language property: The spoken language that was detected in the translated audio data. + * This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. * * @return the language value. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslationFormat.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslationFormat.java index 190de9d73d57..64e6ddf8571f 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslationFormat.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AudioTranslationFormat.java @@ -8,29 +8,42 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines available options for the underlying response format of output translation information. */ +/** + * Defines available options for the underlying response format of output translation information. + */ public final class AudioTranslationFormat extends ExpandableStringEnum { - /** Use a response body that is a JSON object containing a single 'text' field for the translation. */ - @Generated public static final AudioTranslationFormat JSON = fromString("json"); + /** + * Use a response body that is a JSON object containing a single 'text' field for the translation. + */ + @Generated + public static final AudioTranslationFormat JSON = fromString("json"); /** * Use a response body that is a JSON object containing translation text along with timing, segments, and other * metadata. */ - @Generated public static final AudioTranslationFormat VERBOSE_JSON = fromString("verbose_json"); + @Generated + public static final AudioTranslationFormat VERBOSE_JSON = fromString("verbose_json"); - /** Use a response body that is plain text containing the raw, unannotated translation. */ - @Generated public static final AudioTranslationFormat TEXT = fromString("text"); + /** + * Use a response body that is plain text containing the raw, unannotated translation. + */ + @Generated + public static final AudioTranslationFormat TEXT = fromString("text"); - /** Use a response body that is plain text in SubRip (SRT) format that also includes timing information. */ - @Generated public static final AudioTranslationFormat SRT = fromString("srt"); + /** + * Use a response body that is plain text in SubRip (SRT) format that also includes timing information. + */ + @Generated + public static final AudioTranslationFormat SRT = fromString("srt"); /** * Use a response body that is plain text in Web Video Text Tracks (VTT) format that also includes timing * information. */ - @Generated public static final AudioTranslationFormat VTT = fromString("vtt"); + @Generated + public static final AudioTranslationFormat VTT = fromString("vtt"); /** * Creates a new instance of AudioTranslationFormat value. @@ -39,7 +52,8 @@ public final class AudioTranslationFormat extends ExpandableStringEnum tokens, - int seek) { + private AudioTranslationSegment(int id, Duration start, Duration end, String text, double temperature, + double avgLogprob, double compressionRatio, double noSpeechProb, List tokens, int seek) { this.id = id; this.start = (double) start.toNanos() / 1000_000_000L; this.end = (double) end.toNanos() / 1000_000_000L; @@ -132,28 +125,14 @@ private AudioTranslationSegment( @Generated @JsonCreator - private AudioTranslationSegment( - @JsonProperty(value = "id") int id, - @JsonProperty(value = "start") double start, - @JsonProperty(value = "end") double end, - @JsonProperty(value = "text") String text, - @JsonProperty(value = "temperature") double temperature, - @JsonProperty(value = "avg_logprob") double avgLogprob, - @JsonProperty(value = "compression_ratio") double compressionRatio, - @JsonProperty(value = "no_speech_prob") double noSpeechProb, - @JsonProperty(value = "tokens") List tokens, - @JsonProperty(value = "seek") int seek) { - this( - id, - Duration.ofNanos((long) (start * 1000_000_000L)), - Duration.ofNanos((long) (end * 1000_000_000L)), - text, - temperature, - avgLogprob, - compressionRatio, - noSpeechProb, - tokens, - seek); + private AudioTranslationSegment(@JsonProperty(value = "id") int id, @JsonProperty(value = "start") double start, + @JsonProperty(value = "end") double end, @JsonProperty(value = "text") String text, + @JsonProperty(value = "temperature") double temperature, @JsonProperty(value = "avg_logprob") double avgLogprob, + @JsonProperty(value = "compression_ratio") double compressionRatio, + @JsonProperty(value = "no_speech_prob") double noSpeechProb, + @JsonProperty(value = "tokens") List tokens, @JsonProperty(value = "seek") int seek) { + this(id, Duration.ofNanos((long) (start * 1000_000_000L)), Duration.ofNanos((long) (end * 1000_000_000L)), text, + temperature, avgLogprob, compressionRatio, noSpeechProb, tokens, seek); } /** @@ -167,7 +146,8 @@ public int getId() { } /** - * Get the start property: The time at which this segment started relative to the beginning of the translated audio. + * Get the start property: The time at which this segment started relative to the beginning of the translated + * audio. * * @return the start value. */ @@ -247,10 +227,12 @@ public List getTokens() { } /** - * Get the seek property: The seek position associated with the processing of this audio segment. Seek positions are - * expressed as hundredths of seconds. The model may process several segments from a single seek position, so while - * the seek position will never represent a later time than the segment's start, the segment's start may represent a - * significantly later time than the segment's associated seek position. + * Get the seek property: The seek position associated with the processing of this audio segment. + * Seek positions are expressed as hundredths of seconds. + * The model may process several segments from a single seek position, so while the seek position will never + * represent + * a later time than the segment's start, the segment's start may represent a significantly later time than the + * segment's associated seek position. * * @return the seek value. */ 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..c8db56d7bbab 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; @@ -10,8 +10,8 @@ /** * A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat - * completions request that should use Azure OpenAI chat extensions to augment the response behavior. The use of this - * configuration is compatible only with Azure OpenAI. + * completions request that should use Azure OpenAI chat extensions to augment the response behavior. + * The use of this configuration is compatible only with Azure OpenAI. */ @Immutable public final class AzureChatExtensionConfiguration { @@ -41,16 +41,16 @@ public final class AzureChatExtensionConfiguration { */ @Generated @JsonCreator - public AzureChatExtensionConfiguration( - @JsonProperty(value = "type") AzureChatExtensionType type, - @JsonProperty(value = "parameters") Object parameters) { + public AzureChatExtensionConfiguration(@JsonProperty(value = "type") AzureChatExtensionType type, + @JsonProperty(value = "parameters") Object parameters) { this.type = type; this.parameters = parameters; } /** * Get the type property: The label for the type of an Azure chat extension. This typically corresponds to a - * matching Azure resource. Azure chat extensions are only compatible with Azure OpenAI. + * matching Azure resource. + * Azure chat extensions are only compatible with Azure OpenAI. * * @return the type value. */ @@ -60,9 +60,10 @@ public AzureChatExtensionType getType() { } /** - * Get the parameters property: The configuration payload used for the Azure chat extension. The structure payload - * details are specific to the extension being configured. Azure chat extensions are only compatible with Azure - * OpenAI. + * Get the parameters property: The configuration payload used for the Azure chat extension. The structure + * payload details are specific to the + * extension being configured. + * Azure chat extensions are only compatible with Azure OpenAI. * * @return the parameters value. */ 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..a26c0cc1b339 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; @@ -10,13 +10,16 @@ /** * A representation of configuration data for a single Azure OpenAI chat extension. This will be used by a chat - * completions request that should use Azure OpenAI chat extensions to augment the response behavior. The use of this - * configuration is compatible only with Azure OpenAI. + * completions request that should use Azure OpenAI chat extensions to augment the response behavior. + * The use of this configuration is compatible only with Azure OpenAI. */ public final class AzureChatExtensionType extends ExpandableStringEnum { - /** Represents the use of Azure Cognitive Search as an Azure OpenAI chat extension. */ - @Generated public static final AzureChatExtensionType AZURE_COGNITIVE_SEARCH = fromString("AzureCognitiveSearch"); + /** + * Represents the use of Azure Cognitive Search as an Azure OpenAI chat extension. + */ + @Generated + public static final AzureChatExtensionType AZURE_COGNITIVE_SEARCH = fromString("AzureCognitiveSearch"); /** * Creates a new instance of AzureChatExtensionType value. @@ -25,7 +28,8 @@ public final class AzureChatExtensionType extends ExpandableStringEnum messages; - /** Creates an instance of AzureChatExtensionsMessageContext class. */ + /** + * Creates an instance of AzureChatExtensionsMessageContext class. + */ @Generated - public AzureChatExtensionsMessageContext() {} + public AzureChatExtensionsMessageContext() { + } /** * Get the messages property: The contextual message payload associated with the Azure chat extensions used for a - * chat completions request. These messages describe the data source retrievals, plugin invocations, and other - * intermediate steps taken in the course of generating a chat completions response that was augmented by - * capabilities from Azure OpenAI chat extensions. + * chat completions request. + * These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in + * the + * course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat + * extensions. * * @return the messages value. */ @@ -46,9 +51,11 @@ public List getMessages() { /** * Set the messages property: The contextual message payload associated with the Azure chat extensions used for a - * chat completions request. These messages describe the data source retrievals, plugin invocations, and other - * intermediate steps taken in the course of generating a chat completions response that was augmented by - * capabilities from Azure OpenAI chat extensions. + * chat completions request. + * These messages describe the data source retrievals, plugin invocations, and other intermediate steps taken in + * the + * course of generating a chat completions response that was augmented by capabilities from Azure OpenAI chat + * extensions. * * @param messages the messages value to set. * @return the AzureChatExtensionsMessageContext object itself. 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..45c7db0bf5f9 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. @@ -38,10 +41,8 @@ public class AzureCognitiveSearchChatExtensionConfiguration { * @param indexName the name of the index to use in the referenced Azure Cognitive Search resource */ @JsonCreator - public AzureCognitiveSearchChatExtensionConfiguration( - @JsonProperty(value = "endpoint") String endpoint, - @JsonProperty(value = "key") String key, - @JsonProperty(value = "indexName") String indexName) { + public AzureCognitiveSearchChatExtensionConfiguration(@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 +107,233 @@ 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..38bdca87675d --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchIndexFieldMappingOptions.java @@ -0,0 +1,197 @@ +// 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..1edbc6363d2e --- /dev/null +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/AzureCognitiveSearchQueryType.java @@ -0,0 +1,78 @@ +// 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..1f4e7476cc4e 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; @@ -8,30 +8,40 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The state of a job or item. */ +/** + * The state of a job or item. + */ public final class AzureOpenAIOperationState extends ExpandableStringEnum { - /** The operation was created and is queued to be processed in the future. */ - @Generated public static final AzureOpenAIOperationState NOT_RUNNING = fromString("notRunning"); - - /** The operation has started to be processed. */ - @Generated public static final AzureOpenAIOperationState RUNNING = fromString("running"); + /** + * The operation was created and is queued to be processed in the future. + */ + @Generated + public static final AzureOpenAIOperationState NOT_RUNNING = fromString("notRunning"); - /** The operation has successfully be processed and is ready for consumption. */ - @Generated public static final AzureOpenAIOperationState SUCCEEDED = fromString("succeeded"); + /** + * The operation has started to be processed. + */ + @Generated + public static final AzureOpenAIOperationState RUNNING = fromString("running"); - /** The operation has been canceled and is incomplete. */ - @Generated public static final AzureOpenAIOperationState CANCELED = fromString("canceled"); + /** + * The operation has successfully be processed and is ready for consumption. + */ + @Generated + public static final AzureOpenAIOperationState SUCCEEDED = fromString("succeeded"); - /** The operation has completed processing with a failure and cannot be further consumed. */ - @Generated public static final AzureOpenAIOperationState FAILED = fromString("failed"); + /** + * The operation has been canceled and is incomplete. + */ + @Generated + public static final AzureOpenAIOperationState CANCELED = fromString("canceled"); /** - * The entity has been deleted but may still be referenced by other entities that originated before the deletion. - * Note that this state is not used by some Azure OpenAI long-running operations and may not represent a terminal - * state for those operations. + * The operation has completed processing with a failure and cannot be further consumed. */ - @Generated public static final AzureOpenAIOperationState DELETED = fromString("deleted"); + @Generated + public static final AzureOpenAIOperationState FAILED = fromString("failed"); /** * Creates a new instance of AzureOpenAIOperationState value. @@ -40,7 +50,8 @@ public final class AzureOpenAIOperationState extends ExpandableStringEnum ch @Generated @JsonCreator - private ChatCompletions( - @JsonProperty(value = "id") String id, - @JsonProperty(value = "created") long createdAt, - @JsonProperty(value = "choices") List choices, - @JsonProperty(value = "usage") CompletionsUsage usage) { + private ChatCompletions(@JsonProperty(value = "id") String id, @JsonProperty(value = "created") long createdAt, + @JsonProperty(value = "choices") List choices, + @JsonProperty(value = "usage") CompletionsUsage usage) { this(id, OffsetDateTime.ofInstant(Instant.ofEpochSecond(createdAt), ZoneOffset.UTC), choices, usage); } } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java index 7361a617c8e0..44724dbbcc9a 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatCompletionsOptions.java @@ -1,14 +1,12 @@ // 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.ai.openai.implementation.models.FunctionCallModelBase; import com.azure.ai.openai.implementation.models.FunctionCallPreset; -import com.azure.ai.openai.implementation.models.FunctionCallPresetFunctionCallModel; -import com.azure.ai.openai.implementation.models.FunctionNameFunctionCallModel; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -16,8 +14,9 @@ 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. + * 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 { @@ -147,8 +146,9 @@ public ChatCompletionsOptions(@JsonProperty(value = "messages") List getLogitBias() { /** * 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. + * 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. @@ -291,8 +303,9 @@ public ChatCompletionsOptions setUser(String user) { /** * 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. + * 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. */ @@ -303,8 +316,9 @@ public Integer getN() { /** * 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. + * 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. @@ -339,8 +353,10 @@ public ChatCompletionsOptions setStop(List stop) { /** * 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. + * 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. */ @@ -351,8 +367,10 @@ public Double getPresencePenalty() { /** * 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. + * 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. @@ -364,9 +382,11 @@ public ChatCompletionsOptions setPresencePenalty(Double presencePenalty) { } /** - * 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. + * 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. */ @@ -376,9 +396,11 @@ public Double getFrequencyPenalty() { } /** - * 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. + * 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. @@ -412,8 +434,9 @@ public ChatCompletionsOptions setStream(Boolean stream) { } /** - * 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. + * 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. */ @@ -423,8 +446,9 @@ public String getModel() { } /** - * 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. + * 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. @@ -450,12 +474,13 @@ public ChatCompletionsOptions setModel(String model) { */ @Generated @JsonProperty(value = "function_call") - private FunctionCallModelBase functionCall; + private BinaryData functionCall; /* * Field not used for serialization. This is a convenience helper field for the serialization of "function_call". */ - @JsonIgnore private FunctionCallConfig functionCallConfig; + @JsonIgnore + private FunctionCallConfig functionCallConfig; /** * Get the functions property: A list of functions the model may generate JSON inputs for. @@ -487,7 +512,7 @@ public ChatCompletionsOptions setFunctions(List functions) { * * @return the functionCall value. */ - FunctionCallModelBase getFunctionCallInternal() { + BinaryData getFunctionCallInternal() { return this.functionCall; } @@ -500,7 +525,7 @@ FunctionCallModelBase getFunctionCallInternal() { * @param functionCall the functionCall value to set. * @return the ChatCompletionsOptions object itself. */ - ChatCompletionsOptions setFunctionCallInternal(FunctionCallModelBase functionCall) { + ChatCompletionsOptions setFunctionCallInternal(BinaryData functionCall) { this.functionCall = functionCall; return this; } @@ -529,12 +554,10 @@ public FunctionCallConfig getFunctionCall() { public ChatCompletionsOptions setFunctionCall(FunctionCallConfig functionCallConfig) { this.functionCallConfig = functionCallConfig; if (FunctionCallPreset.values().stream() - .anyMatch(preset -> preset.toString().equals(functionCallConfig.getName()))) { - this.functionCall = - new FunctionCallPresetFunctionCallModel( - FunctionCallPreset.fromString(this.functionCallConfig.getName())); + .anyMatch(preset -> preset.toString().equals(functionCallConfig.getName()))) { + this.functionCall = BinaryData.fromObject(FunctionCallPreset.fromString(this.functionCallConfig.getName())); } else { - this.functionCall = new FunctionNameFunctionCallModel(new FunctionName(this.functionCallConfig.getName())); + this.functionCall = BinaryData.fromObject(new FunctionName(this.functionCallConfig.getName())); } return this; } @@ -548,8 +571,8 @@ public ChatCompletionsOptions setFunctionCall(FunctionCallConfig functionCallCon private List dataSources; /** - * Get the dataSources property: The configuration entries for Azure OpenAI chat extensions that use them. This - * additional specification is only compatible with Azure OpenAI. + * 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. */ @@ -559,8 +582,8 @@ public List getDataSources() { } /** - * Set the dataSources property: The configuration entries for Azure OpenAI chat extensions that use them. This - * additional specification is only compatible with Azure OpenAI. + * 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. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessage.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessage.java index 7c06c92d19bc..80589678ca66 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessage.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatMessage.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; @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -/** A single, role-attributed message within a chat completion interaction. */ +/** + * A single, role-attributed message within a chat completion interaction. + */ @Fluent public final class ChatMessage { @@ -66,8 +68,10 @@ public String getContent() { /** * Get the name property: The name of the author of this message. `name` is required if role is `function`, and it - * should be the name of the function whose response is in the `content`. May contain a-z, A-Z, 0-9, and - * underscores, with a maximum length of 64 characters. + * should be the name of the + * function whose response is in the `content`. May contain a-z, A-Z, 0-9, and underscores, with a maximum length + * of + * 64 characters. * * @return the name value. */ @@ -78,8 +82,10 @@ public String getName() { /** * Set the name property: The name of the author of this message. `name` is required if role is `function`, and it - * should be the name of the function whose response is in the `content`. May contain a-z, A-Z, 0-9, and - * underscores, with a maximum length of 64 characters. + * should be the name of the + * function whose response is in the `content`. May contain a-z, A-Z, 0-9, and underscores, with a maximum length + * of + * 64 characters. * * @param name the name value to set. * @return the ChatMessage object itself. @@ -138,10 +144,11 @@ public ChatMessage(@JsonProperty(value = "role") ChatRole role, @JsonProperty(va private AzureChatExtensionsMessageContext context; /** - * Get the context property: Additional context data associated with a chat message when requesting chat completions - * using compatible Azure OpenAI chat extensions. This includes information like the intermediate data source - * retrievals used to service a request. This context information is only populated when using Azure OpenAI with - * chat extensions capabilities configured. + * Get the context property: Additional context data associated with a chat message when requesting chat + * completions using compatible Azure + * OpenAI chat extensions. This includes information like the intermediate data source retrievals used to service a + * request. + * This context information is only populated when using Azure OpenAI with chat extensions capabilities configured. * * @return the context value. */ @@ -151,10 +158,11 @@ public AzureChatExtensionsMessageContext getContext() { } /** - * Set the context property: Additional context data associated with a chat message when requesting chat completions - * using compatible Azure OpenAI chat extensions. This includes information like the intermediate data source - * retrievals used to service a request. This context information is only populated when using Azure OpenAI with - * chat extensions capabilities configured. + * Set the context property: Additional context data associated with a chat message when requesting chat + * completions using compatible Azure + * OpenAI chat extensions. This includes information like the intermediate data source retrievals used to service a + * request. + * This context information is only populated when using Azure OpenAI with chat extensions capabilities configured. * * @param context the context value to set. * @return the ChatMessage object itself. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatRole.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatRole.java index 42e85eea7fa7..c91985b70ab9 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatRole.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ChatRole.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; @@ -8,17 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** A description of the intended purpose of a message within a chat completions interaction. */ +/** + * A description of the intended purpose of a message within a chat completions interaction. + */ public final class ChatRole extends ExpandableStringEnum { - /** The role that instructs or sets the behavior of the assistant. */ - @Generated public static final ChatRole SYSTEM = fromString("system"); + /** + * The role that instructs or sets the behavior of the assistant. + */ + @Generated + public static final ChatRole SYSTEM = fromString("system"); - /** The role that provides responses to system-instructed, user-prompted input. */ - @Generated public static final ChatRole ASSISTANT = fromString("assistant"); + /** + * The role that provides responses to system-instructed, user-prompted input. + */ + @Generated + public static final ChatRole ASSISTANT = fromString("assistant"); - /** The role that provides input for chat completions. */ - @Generated public static final ChatRole USER = fromString("user"); + /** + * The role that provides input for chat completions. + */ + @Generated + public static final ChatRole USER = fromString("user"); /** * Creates a new instance of ChatRole value. @@ -27,7 +38,8 @@ public final class ChatRole extends ExpandableStringEnum { */ @Generated @Deprecated - public ChatRole() {} + public ChatRole() { + } /** * Creates or finds a ChatRole from its string representation. @@ -51,9 +63,15 @@ public static Collection values() { return values(ChatRole.class); } - /** The role that provides function results for chat completions. */ - @Generated public static final ChatRole FUNCTION = fromString("function"); + /** + * The role that provides function results for chat completions. + */ + @Generated + public static final ChatRole FUNCTION = fromString("function"); - /** The role that represents extension tool activity within a chat completions operation. */ - @Generated public static final ChatRole TOOL = fromString("tool"); + /** + * The role that represents extension tool activity within a chat completions operation. + */ + @Generated + public static final ChatRole TOOL = fromString("tool"); } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Choice.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Choice.java index 5ac5f97ed15a..3db3d18bf544 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Choice.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Choice.java @@ -9,9 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * The representation of a single prompt completion as part of an overall completions request. Generally, `n` choices - * are generated per provided prompt with a default value of 1. Token limits and other settings may limit the number of - * choices generated. + * The representation of a single prompt completion as part of an overall completions request. + * Generally, `n` choices are generated per provided prompt with a default value of 1. + * Token limits and other settings may limit the number of choices generated. */ @Immutable public final class Choice { @@ -54,11 +54,9 @@ public final class Choice { */ @Generated @JsonCreator - private Choice( - @JsonProperty(value = "text") String text, - @JsonProperty(value = "index") int index, - @JsonProperty(value = "logprobs") CompletionsLogProbabilityModel logprobs, - @JsonProperty(value = "finish_reason") CompletionsFinishReason finishReason) { + private Choice(@JsonProperty(value = "text") String text, @JsonProperty(value = "index") int index, + @JsonProperty(value = "logprobs") CompletionsLogProbabilityModel logprobs, + @JsonProperty(value = "finish_reason") CompletionsFinishReason finishReason) { this.text = text; this.index = index; this.logprobs = logprobs; @@ -116,7 +114,8 @@ public CompletionsFinishReason getFinishReason() { /** * Get the contentFilterResults property: Information about the content filtering category (hate, sexual, violence, - * self_harm), if it has been detected, as well as the severity level (very_low, low, medium, high-scale that + * self_harm), if it + * has been detected, as well as the severity level (very_low, low, medium, high-scale that * determines the intensity and risk level of harmful content) and if it has been filtered or not. * * @return the contentFilterResults value. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Completions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Completions.java index f9f4258d5ccd..4ee2dc5c20f2 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Completions.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Completions.java @@ -13,8 +13,9 @@ import java.util.List; /** - * Representation of the response data from a completions request. Completions support a wide variety of tasks and - * generate text that continues from or "completes" provided prompt data. + * Representation of the response data from a completions request. + * Completions support a wide variety of tasks and generate text that continues from or "completes" + * provided prompt data. */ @Immutable public final class Completions { @@ -54,8 +55,8 @@ public String getId() { /** * Get the choices property: The collection of completions choices associated with this completions response. - * Generally, `n` choices are generated per provided prompt with a default value of 1. Token limits and other - * settings may limit the number of choices generated. + * Generally, `n` choices are generated per provided prompt with a default value of 1. + * Token limits and other settings may limit the number of choices generated. * * @return the choices value. */ @@ -132,17 +133,15 @@ private Completions(String id, OffsetDateTime createdAt, List choices, C @Generated @JsonCreator - private Completions( - @JsonProperty(value = "id") String id, - @JsonProperty(value = "created") long createdAt, - @JsonProperty(value = "choices") List choices, - @JsonProperty(value = "usage") CompletionsUsage usage) { + private Completions(@JsonProperty(value = "id") String id, @JsonProperty(value = "created") long createdAt, + @JsonProperty(value = "choices") List choices, @JsonProperty(value = "usage") CompletionsUsage usage) { this(id, OffsetDateTime.ofInstant(Instant.ofEpochSecond(createdAt), ZoneOffset.UTC), choices, usage); } /** * Get the createdAt property: The first timestamp associated with generation activity for this completions - * response, represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. + * response, + * represented as seconds since the beginning of the Unix epoch of 00:00 on 1 Jan 1970. * * @return the createdAt value. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsFinishReason.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsFinishReason.java index fb2512854f1c..93b464170b7f 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsFinishReason.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsFinishReason.java @@ -8,19 +8,29 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Representation of the manner in which a completions response concluded. */ +/** + * Representation of the manner in which a completions response concluded. + */ public final class CompletionsFinishReason extends ExpandableStringEnum { - /** Completions ended normally and reached its end of token generation. */ - @Generated public static final CompletionsFinishReason STOPPED = fromString("stop"); + /** + * Completions ended normally and reached its end of token generation. + */ + @Generated + public static final CompletionsFinishReason STOPPED = fromString("stop"); - /** Completions exhausted available token limits before generation could complete. */ - @Generated public static final CompletionsFinishReason TOKEN_LIMIT_REACHED = fromString("length"); + /** + * Completions exhausted available token limits before generation could complete. + */ + @Generated + public static final CompletionsFinishReason TOKEN_LIMIT_REACHED = fromString("length"); /** - * Completions generated a response that was identified as potentially sensitive per content moderation policies. + * Completions generated a response that was identified as potentially sensitive per content + * moderation policies. */ - @Generated public static final CompletionsFinishReason CONTENT_FILTERED = fromString("content_filter"); + @Generated + public static final CompletionsFinishReason CONTENT_FILTERED = fromString("content_filter"); /** * Creates a new instance of CompletionsFinishReason value. @@ -29,7 +39,8 @@ public final class CompletionsFinishReason extends ExpandableStringEnum values() { return values(CompletionsFinishReason.class); } - /** Completion ended normally, with the model requesting a function to be called. */ - @Generated public static final CompletionsFinishReason FUNCTION_CALL = fromString("function_call"); + /** + * Completion ended normally, with the model requesting a function to be called. + */ + @Generated + public static final CompletionsFinishReason FUNCTION_CALL = fromString("function_call"); } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsLogProbabilityModel.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsLogProbabilityModel.java index 335f6f372189..cb9f0a00cc10 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsLogProbabilityModel.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsLogProbabilityModel.java @@ -10,7 +10,9 @@ import java.util.List; import java.util.Map; -/** Representation of a log probabilities model for a completions generation. */ +/** + * Representation of a log probabilities model for a completions generation. + */ @Immutable public final class CompletionsLogProbabilityModel { @@ -31,11 +33,10 @@ public final class CompletionsLogProbabilityModel { */ @Generated @JsonCreator - private CompletionsLogProbabilityModel( - @JsonProperty(value = "tokens") List tokens, - @JsonProperty(value = "token_logprobs") List tokenLogProbabilities, - @JsonProperty(value = "top_logprobs") List> topLogProbabilities, - @JsonProperty(value = "text_offset") List textOffsets) { + private CompletionsLogProbabilityModel(@JsonProperty(value = "tokens") List tokens, + @JsonProperty(value = "token_logprobs") List tokenLogProbabilities, + @JsonProperty(value = "top_logprobs") List> topLogProbabilities, + @JsonProperty(value = "text_offset") List textOffsets) { this.tokens = tokens; this.tokenLogProbabilities = tokenLogProbabilities; this.topLogProbabilities = topLogProbabilities; @@ -74,8 +75,8 @@ public List getTokens() { private List textOffsets; /** - * Get the tokenLogProbabilities property: A collection of log probability values for the tokens in this completions - * data. + * Get the tokenLogProbabilities property: A collection of log probability values for the tokens in this + * completions data. * * @return the tokenLogProbabilities value. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsOptions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsOptions.java index 563dd5c22084..f4ef671a97c9 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsOptions.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsOptions.java @@ -11,8 +11,9 @@ import java.util.Map; /** - * 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. + * 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. */ @Fluent public final class CompletionsOptions { @@ -199,8 +200,10 @@ public CompletionsOptions setMaxTokens(Integer maxTokens) { /** * 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 + * 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. @@ -212,8 +215,10 @@ public Double getTemperature() { /** * 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 + * 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. @@ -226,11 +231,13 @@ public CompletionsOptions setTemperature(Double temperature) { } /** - * 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. + * 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. */ @@ -240,11 +247,13 @@ public Double getTopP() { } /** - * 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. + * 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 CompletionsOptions object itself. @@ -257,9 +266,11 @@ public CompletionsOptions setTopP(Double topP) { /** * 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. + * 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. */ @@ -270,9 +281,11 @@ public Map getLogitBias() { /** * 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. + * 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 CompletionsOptions object itself. @@ -309,8 +322,9 @@ public CompletionsOptions setUser(String user) { /** * Get the n property: The number of completions choices that should be generated per provided prompt as part of an - * overall 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. + * overall 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. */ @@ -321,8 +335,9 @@ public Integer getN() { /** * Set the n property: The number of completions choices that should be generated per provided prompt as part of an - * overall 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. + * overall 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 CompletionsOptions object itself. @@ -335,7 +350,8 @@ public CompletionsOptions setN(Integer n) { /** * Get the logprobs property: A value that controls the emission of log probabilities for the provided number of - * most likely tokens within a completions response. + * most likely + * tokens within a completions response. * * @return the logprobs value. */ @@ -346,7 +362,8 @@ public Integer getLogprobs() { /** * Set the logprobs property: A value that controls the emission of log probabilities for the provided number of - * most likely tokens within a completions response. + * most likely + * tokens within a completions response. * * @param logprobs the logprobs value to set. * @return the CompletionsOptions object itself. @@ -359,7 +376,8 @@ public CompletionsOptions setLogprobs(Integer logprobs) { /** * Get the echo property: A value specifying whether completions responses should include input prompts as prefixes - * to their generated output. + * to + * their generated output. * * @return the echo value. */ @@ -370,7 +388,8 @@ public Boolean isEcho() { /** * Set the echo property: A value specifying whether completions responses should include input prompts as prefixes - * to their generated output. + * to + * their generated output. * * @param echo the echo value to set. * @return the CompletionsOptions object itself. @@ -405,8 +424,10 @@ public CompletionsOptions setStop(List stop) { /** * 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. + * 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. */ @@ -417,8 +438,10 @@ public Double getPresencePenalty() { /** * 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. + * 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 CompletionsOptions object itself. @@ -430,9 +453,11 @@ public CompletionsOptions setPresencePenalty(Double presencePenalty) { } /** - * 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. + * 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. */ @@ -442,9 +467,11 @@ public Double getFrequencyPenalty() { } /** - * 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. + * 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 CompletionsOptions object itself. @@ -457,9 +484,12 @@ public CompletionsOptions setFrequencyPenalty(Double frequencyPenalty) { /** * Get the bestOf property: A value that controls how many completions will be internally generated prior to - * response formulation. When used together with n, best_of controls the number of candidate completions and must be - * greater than n. 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. + * response + * formulation. + * When used together with n, best_of controls the number of candidate completions and must be + * greater than n. + * 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 bestOf value. */ @@ -470,9 +500,12 @@ public Integer getBestOf() { /** * Set the bestOf property: A value that controls how many completions will be internally generated prior to - * response formulation. When used together with n, best_of controls the number of candidate completions and must be - * greater than n. 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. + * response + * formulation. + * When used together with n, best_of controls the number of candidate completions and must be + * greater than n. + * 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 bestOf the bestOf value to set. * @return the CompletionsOptions object itself. @@ -506,8 +539,9 @@ public CompletionsOptions setStream(Boolean stream) { } /** - * 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. + * 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. */ @@ -517,8 +551,9 @@ public String getModel() { } /** - * 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. + * 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 CompletionsOptions object itself. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsUsage.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsUsage.java index 7ead532d72ee..251adda6dfe9 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsUsage.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/CompletionsUsage.java @@ -9,8 +9,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Representation of the token counts processed for a completions request. Counts consider all tokens across prompts, - * choices, choice alternates, best_of generations, and other consumers. + * Representation of the token counts processed for a completions request. + * Counts consider all tokens across prompts, choices, choice alternates, best_of generations, and + * other consumers. */ @Immutable public final class CompletionsUsage { @@ -45,10 +46,9 @@ public final class CompletionsUsage { */ @Generated @JsonCreator - private CompletionsUsage( - @JsonProperty(value = "completion_tokens") int completionTokens, - @JsonProperty(value = "prompt_tokens") int promptTokens, - @JsonProperty(value = "total_tokens") int totalTokens) { + private CompletionsUsage(@JsonProperty(value = "completion_tokens") int completionTokens, + @JsonProperty(value = "prompt_tokens") int promptTokens, + @JsonProperty(value = "total_tokens") int totalTokens) { this.completionTokens = completionTokens; this.promptTokens = promptTokens; this.totalTokens = totalTokens; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterResult.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterResult.java index 9d7094c71e97..ac2a3c670fc9 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterResult.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterResult.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -/** Information about filtered content severity level and if it has been filtered or not. */ +/** + * Information about filtered content severity level and if it has been filtered or not. + */ @Immutable public final class ContentFilterResult { @@ -34,9 +36,8 @@ public final class ContentFilterResult { */ @Generated @JsonCreator - private ContentFilterResult( - @JsonProperty(value = "severity") ContentFilterSeverity severity, - @JsonProperty(value = "filtered") boolean filtered) { + private ContentFilterResult(@JsonProperty(value = "severity") ContentFilterSeverity severity, + @JsonProperty(value = "filtered") boolean filtered) { this.severity = severity; this.filtered = filtered; } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterResults.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterResults.java index 3bbe279c3d7f..4c060a42b8d5 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterResults.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterResults.java @@ -8,7 +8,9 @@ import com.azure.core.models.ResponseError; import com.fasterxml.jackson.annotation.JsonProperty; -/** Information about the content filtering category, if it has been detected. */ +/** + * Information about the content filtering category, if it has been detected. + */ @Immutable public final class ContentFilterResults { @@ -51,8 +53,9 @@ public final class ContentFilterResults { /** * Get the sexual property: Describes language related to anatomical organs and genitals, romantic relationships, - * acts portrayed in erotic or affectionate terms, physical sexual acts, including those portrayed as an assault or - * a forced sexual violent act against one’s will, prostitution, pornography, and abuse. + * acts portrayed in erotic or affectionate terms, physical sexual acts, including + * those portrayed as an assault or a forced sexual violent act against one’s will, + * prostitution, pornography, and abuse. * * @return the sexual value. */ @@ -73,10 +76,11 @@ public ContentFilterResult getViolence() { } /** - * Get the hate property: Describes language attacks or uses that include pejorative or discriminatory language with - * reference to a person or identity group on the basis of certain differentiating attributes of these groups - * including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - * religion, immigration status, ability status, personal appearance, and body size. + * Get the hate property: Describes language attacks or uses that include pejorative or discriminatory language + * with reference to a person or identity group on the basis of certain differentiating + * attributes of these groups including but not limited to race, ethnicity, nationality, + * gender identity and expression, sexual orientation, religion, immigration status, ability + * status, personal appearance, and body size. * * @return the hate value. */ @@ -86,8 +90,8 @@ public ContentFilterResult getHate() { } /** - * Get the selfHarm property: Describes language related to physical actions intended to purposely hurt, injure, or - * damage one’s body, or kill oneself. + * Get the selfHarm property: Describes language related to physical actions intended to purposely hurt, injure, + * or damage one’s body, or kill oneself. * * @return the selfHarm value. */ @@ -96,9 +100,12 @@ public ContentFilterResult getSelfHarm() { return this.selfHarm; } - /** Creates an instance of ContentFilterResults class. */ + /** + * Creates an instance of ContentFilterResults class. + */ @Generated - private ContentFilterResults() {} + private ContentFilterResults() { + } /* * Describes an error returned if the content filtering system is @@ -109,8 +116,8 @@ private ContentFilterResults() {} private ResponseError error; /** - * Get the error property: Describes an error returned if the content filtering system is down or otherwise unable - * to complete the operation in time. + * Get the error property: Describes an error returned if the content filtering system is + * down or otherwise unable to complete the operation in time. * * @return the error value. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterSeverity.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterSeverity.java index 9f8dce93d48e..d70af4818be2 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterSeverity.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ContentFilterSeverity.java @@ -8,35 +8,43 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Ratings for the intensity and risk level of harmful content. */ +/** + * Ratings for the intensity and risk level of harmful content. + */ public final class ContentFilterSeverity extends ExpandableStringEnum { /** - * Content may be related to violence, self-harm, sexual, or hate categories but the terms are used in general, - * journalistic, scientific, medical, and similar professional contexts, which are appropriate for most audiences. + * Content may be related to violence, self-harm, sexual, or hate categories but the terms + * are used in general, journalistic, scientific, medical, and similar professional contexts, + * which are appropriate for most audiences. */ - @Generated public static final ContentFilterSeverity SAFE = fromString("safe"); + @Generated + public static final ContentFilterSeverity SAFE = fromString("safe"); /** - * Content that expresses prejudiced, judgmental, or opinionated views, includes offensive use of language, - * stereotyping, use cases exploring a fictional world (for example, gaming, literature) and depictions at low - * intensity. + * Content that expresses prejudiced, judgmental, or opinionated views, includes offensive + * use of language, stereotyping, use cases exploring a fictional world (for example, gaming, + * literature) and depictions at low intensity. */ - @Generated public static final ContentFilterSeverity LOW = fromString("low"); + @Generated + public static final ContentFilterSeverity LOW = fromString("low"); /** - * Content that uses offensive, insulting, mocking, intimidating, or demeaning language towards specific identity - * groups, includes depictions of seeking and executing harmful instructions, fantasies, glorification, promotion of - * harm at medium intensity. + * Content that uses offensive, insulting, mocking, intimidating, or demeaning language + * towards specific identity groups, includes depictions of seeking and executing harmful + * instructions, fantasies, glorification, promotion of harm at medium intensity. */ - @Generated public static final ContentFilterSeverity MEDIUM = fromString("medium"); + @Generated + public static final ContentFilterSeverity MEDIUM = fromString("medium"); /** - * Content that displays explicit and severe harmful instructions, actions, damage, or abuse; includes endorsement, - * glorification, or promotion of severe harmful acts, extreme or illegal forms of harm, radicalization, or - * non-consensual power exchange or abuse. + * Content that displays explicit and severe harmful instructions, actions, + * damage, or abuse; includes endorsement, glorification, or promotion of severe + * harmful acts, extreme or illegal forms of harm, radicalization, or non-consensual + * power exchange or abuse. */ - @Generated public static final ContentFilterSeverity HIGH = fromString("high"); + @Generated + public static final ContentFilterSeverity HIGH = fromString("high"); /** * Creates a new instance of ContentFilterSeverity value. @@ -45,7 +53,8 @@ public final class ContentFilterSeverity extends ExpandableStringEnum embedding, @JsonProperty(value = "index") int promptIndex) { + private EmbeddingItem(@JsonProperty(value = "embedding") List embedding, + @JsonProperty(value = "index") int promptIndex) { this.embedding = embedding; this.promptIndex = promptIndex; } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Embeddings.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Embeddings.java index 3029897338de..0c3f6f799c04 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Embeddings.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/Embeddings.java @@ -10,8 +10,9 @@ import java.util.List; /** - * 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. + * 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. */ @Immutable public final class Embeddings { @@ -38,9 +39,8 @@ public final class Embeddings { */ @Generated @JsonCreator - private Embeddings( - @JsonProperty(value = "data") List data, - @JsonProperty(value = "usage") EmbeddingsUsage usage) { + private Embeddings(@JsonProperty(value = "data") List data, + @JsonProperty(value = "usage") EmbeddingsUsage usage) { this.data = data; this.usage = usage; } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/EmbeddingsOptions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/EmbeddingsOptions.java index 0117f9df442a..536c54a50da8 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/EmbeddingsOptions.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/EmbeddingsOptions.java @@ -10,8 +10,9 @@ import java.util.List; /** - * 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. + * 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. */ @Fluent public final class EmbeddingsOptions { @@ -36,7 +37,7 @@ public final class EmbeddingsOptions { /* * Input texts to get embeddings for, encoded as a an array of strings. * Each input must not exceed 2048 tokens in length. - * + * * Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, * as we have observed inferior results when newlines are present. */ @@ -80,8 +81,9 @@ public EmbeddingsOptions setUser(String user) { } /** - * Get the model property: The model name to provide as part of this embeddings request. Not applicable to Azure - * OpenAI, where deployment information should be included in the Azure resource URI that's connected to. + * Get the model property: The model name to provide as part of this embeddings 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. */ @@ -91,8 +93,9 @@ public String getModel() { } /** - * Set the model property: The model name to provide as part of this embeddings request. Not applicable to Azure - * OpenAI, where deployment information should be included in the Azure resource URI that's connected to. + * Set the model property: The model name to provide as part of this embeddings 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 EmbeddingsOptions object itself. @@ -104,11 +107,11 @@ public EmbeddingsOptions setModel(String model) { } /** - * Get the input property: Input texts to get embeddings for, encoded as a an array of strings. Each input must not - * exceed 2048 tokens in length. + * Get the input property: Input texts to get embeddings for, encoded as a an array of strings. + * Each input must not exceed 2048 tokens in length. * - *

Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, as we - * have observed inferior results when newlines are present. + * Unless you are embedding code, we suggest replacing newlines (\n) in your input with a single space, + * as we have observed inferior results when newlines are present. * * @return the input value. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/EmbeddingsUsage.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/EmbeddingsUsage.java index e52cb62cb7f7..a448ca0a3c89 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/EmbeddingsUsage.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/EmbeddingsUsage.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -/** Measurement of the amount of tokens used in this request and response. */ +/** + * Measurement of the amount of tokens used in this request and response. + */ @Immutable public final class EmbeddingsUsage { @@ -34,9 +36,8 @@ public final class EmbeddingsUsage { */ @Generated @JsonCreator - private EmbeddingsUsage( - @JsonProperty(value = "prompt_tokens") int promptTokens, - @JsonProperty(value = "total_tokens") int totalTokens) { + private EmbeddingsUsage(@JsonProperty(value = "prompt_tokens") int promptTokens, + @JsonProperty(value = "total_tokens") int totalTokens) { this.promptTokens = promptTokens; this.totalTokens = totalTokens; } diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionCall.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionCall.java index f03fa51fdb66..1845d9d80061 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionCall.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionCall.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; @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -/** The name and arguments of a function that should be called, as generated by the model. */ +/** + * The name and arguments of a function that should be called, as generated by the model. + */ @Immutable public final class FunctionCall { @@ -37,8 +39,8 @@ public final class FunctionCall { */ @Generated @JsonCreator - public FunctionCall( - @JsonProperty(value = "name") String name, @JsonProperty(value = "arguments") String arguments) { + public FunctionCall(@JsonProperty(value = "name") String name, + @JsonProperty(value = "arguments") String arguments) { this.name = name; this.arguments = arguments; } @@ -55,8 +57,9 @@ public String getName() { /** * Get the arguments property: The arguments to call the function with, as generated by the model in JSON format. - * Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your - * function schema. Validate the arguments in your code before calling your function. + * Note that the model does not always generate valid JSON, and may hallucinate parameters + * not defined by your function schema. Validate the arguments in your code before calling + * your function. * * @return the arguments value. */ diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionDefinition.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionDefinition.java index 04075c14d623..87e45a805efe 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionDefinition.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionDefinition.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; @@ -59,7 +59,8 @@ public String getName() { /** * Get the description property: A description of what the function does. The model will use this description when - * selecting the function and interpreting its parameters. + * selecting the function and + * interpreting its parameters. * * @return the description value. */ @@ -70,7 +71,8 @@ public String getDescription() { /** * Set the description property: A description of what the function does. The model will use this description when - * selecting the function and interpreting its parameters. + * selecting the function and + * interpreting its parameters. * * @param description the description value to set. * @return the FunctionDefinition object itself. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionName.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionName.java index 82b2abb8eff4..5d55af78286b 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionName.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/FunctionName.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/ImageGenerationOptions.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageGenerationOptions.java index 6dd82f096730..d8f78a07fd6c 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageGenerationOptions.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/ImageGenerationOptions.java @@ -1,14 +1,17 @@ // 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.ai.openai.implementation.models.ImageGenerationResponseFormat; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -/** Represents the request data used to generate images. */ +/** + * Represents the request data used to generate images. + */ @Fluent public final class ImageGenerationOptions { @@ -130,4 +133,34 @@ public ImageGenerationOptions setUser(String user) { this.user = user; return this; } + + /* + * The format in which image generation response items should be presented. + * Azure OpenAI only supports URL response items. + */ + @Generated + @JsonProperty(value = "response_format") + private ImageGenerationResponseFormat responseFormat; + + /** + * Get the responseFormat property: The format in which image generation response items should be presented. + * Azure OpenAI only supports URL response items. + * + * @return the responseFormat value. + */ + ImageGenerationResponseFormat getResponseFormat() { + return this.responseFormat; + } + + /** + * Set the responseFormat property: The format in which image generation response items should be presented. + * Azure OpenAI only supports URL response items. + * + * @param responseFormat the responseFormat value to set. + * @return the ImageGenerationOptions object itself. + */ + ImageGenerationOptions setResponseFormat(ImageGenerationResponseFormat responseFormat) { + this.responseFormat = responseFormat; + return this; + } } 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..7dee7b6fd0a9 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; @@ -8,17 +8,28 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024. */ +/** + * The desired size of the generated images. Must be one of 256x256, 512x512, or 1024x1024. + */ public final class ImageSize extends ExpandableStringEnum { - /** Image size of 256x256. */ - @Generated public static final ImageSize SIZE256X256 = fromString("256x256"); + /** + * Image size of 256x256. + */ + @Generated + public static final ImageSize SIZE256X256 = fromString("256x256"); - /** Image size of 512x512. */ - @Generated public static final ImageSize SIZE512X512 = fromString("512x512"); + /** + * Image size of 512x512. + */ + @Generated + public static final ImageSize SIZE512X512 = fromString("512x512"); - /** Image size of 1024x1024. */ - @Generated public static final ImageSize SIZE1024X1024 = fromString("1024x1024"); + /** + * Image size of 1024x1024. + */ + @Generated + public static final ImageSize SIZE1024X1024 = fromString("1024x1024"); /** * Creates a new instance of ImageSize value. @@ -27,7 +38,8 @@ public final class ImageSize extends ExpandableStringEnum { */ @Generated @Deprecated - public ImageSize() {} + public ImageSize() { + } /** * Creates or finds a ImageSize from its string representation. diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PromptFilterResult.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PromptFilterResult.java index 3b5f8eee0bfe..1037d9fec9d0 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PromptFilterResult.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/PromptFilterResult.java @@ -8,7 +8,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -/** Content filtering results for a single prompt in the request. */ +/** + * Content filtering results for a single prompt in the request. + */ @Immutable public final class PromptFilterResult { diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/package-info.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/package-info.java index f52a231702c8..b13943196641 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/package-info.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/models/package-info.java @@ -1,5 +1,7 @@ // 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 containing the data models for OpenAI. Azure OpenAI APIs for completions and search. + */ package com.azure.ai.openai.models; diff --git a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/package-info.java b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/package-info.java index 84f842c5badb..f60f0c440a3f 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/package-info.java +++ b/sdk/openai/azure-ai-openai/src/main/java/com/azure/ai/openai/package-info.java @@ -1,5 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -/** Package containing the classes for OpenAI. Azure OpenAI APIs for completions and search. */ +/** + * Package containing the classes for OpenAI. Azure OpenAI APIs for completions and search. + */ package com.azure.ai.openai; diff --git a/sdk/openai/azure-ai-openai/src/main/java/module-info.java b/sdk/openai/azure-ai-openai/src/main/java/module-info.java index 6d20e7882abc..c1d94542bcd8 100644 --- a/sdk/openai/azure-ai-openai/src/main/java/module-info.java +++ b/sdk/openai/azure-ai-openai/src/main/java/module-info.java @@ -8,13 +8,7 @@ exports com.azure.ai.openai; exports com.azure.ai.openai.models; - opens com.azure.ai.openai.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.ai.openai.implementation.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.ai.openai.implementation to - com.azure.core, - com.fasterxml.jackson.databind; + opens com.azure.ai.openai.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.ai.openai.implementation.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.ai.openai.implementation to com.azure.core, com.fasterxml.jackson.databind; } diff --git a/sdk/openai/azure-ai-openai/tsp-location.yaml b/sdk/openai/azure-ai-openai/tsp-location.yaml index 9dbc49d97eac..52e40531fe3b 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: a0cc9f96a5562f94597d0fa076d864525b40bea6 repo: Azure/azure-rest-api-specs