From 76a15153856558ac563f72138c6ec5f8f4c5338d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 17 Jul 2024 17:24:17 +0000 Subject: [PATCH] CodeGen from PR 29424 in Azure/azure-rest-api-specs Merge 8fab2ddf4a1e25992368baca0a4240d7642e6e8a into e60f9d4c178ff898732a4d59cbc688bf6fa09c00 --- .../azure/ai/openai/OpenAIAsyncClient.java | 84 ++++---- .../com/azure/ai/openai/OpenAIClient.java | 90 ++++---- .../azure/ai/openai/OpenAIServiceVersion.java | 30 +-- .../implementation/OpenAIClientImpl.java | 203 ++++++++++-------- sdk/openai/azure-ai-openai/tsp-location.yaml | 5 +- 5 files changed, 218 insertions(+), 194 deletions(-) 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 c662e400b5ba..283852eca0f1 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 @@ -618,7 +618,9 @@ public Flux> getChatCompletionsStreamWithResponse(Stri * * @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 body Body parameter. + * @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. @@ -631,11 +633,11 @@ public Flux> getChatCompletionsStreamWithResponse(Stri */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getEmbeddings(String deploymentOrModelName, EmbeddingsOptions body) { + public Mono getEmbeddings(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions) { // Generated convenience method for getEmbeddingsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions) - .flatMap(FluxUtil::toMono) + return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), + requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Embeddings.class)); } @@ -646,7 +648,9 @@ public Mono getEmbeddings(String deploymentOrModelName, EmbeddingsOp * * @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 body Body parameter. + * @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. @@ -659,11 +663,11 @@ public Mono getEmbeddings(String deploymentOrModelName, EmbeddingsOp */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCompletions(String deploymentOrModelName, CompletionsOptions body) { + public Mono getCompletions(String deploymentOrModelName, CompletionsOptions completionsOptions) { // Generated convenience method for getCompletionsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions) - .flatMap(FluxUtil::toMono) + return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(completionsOptions), + requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(Completions.class)); } @@ -740,7 +744,9 @@ public Flux getCompletionsStream(String deploymentOrModelName, Comp * * @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 body Body parameter. + * @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. @@ -753,11 +759,12 @@ public Flux getCompletionsStream(String deploymentOrModelName, Comp */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getChatCompletions(String deploymentOrModelName, ChatCompletionsOptions body) { + public Mono getChatCompletions(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions) { // Generated convenience method for getChatCompletionsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getChatCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions) - .flatMap(FluxUtil::toMono) + return getChatCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions), + requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class)); } @@ -830,7 +837,7 @@ public Flux getChatCompletionsStream(String deploymentOrModelNa * * @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 body Body parameter. + * @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. @@ -842,11 +849,11 @@ public Flux getChatCompletionsStream(String deploymentOrModelNa @Generated @ServiceMethod(returns = ReturnType.SINGLE) Mono> getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + 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, body, - requestOptions); + return this.serviceClient.getAudioTranscriptionAsResponseObjectWithResponseAsync(deploymentOrModelName, + audioTranscriptionOptions, requestOptions); } /** @@ -1143,7 +1150,7 @@ public Mono> getAudioTranslationTextWithResponse(String deploym * * @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 body Body parameter. + * @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. @@ -1155,11 +1162,11 @@ public Mono> getAudioTranslationTextWithResponse(String deploym @Generated @ServiceMethod(returns = ReturnType.SINGLE) Mono> getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation // 'getAudioTranscriptionAsPlainText' is 'multipart/form-data' - return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponseAsync(deploymentOrModelName, body, - requestOptions); + return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponseAsync(deploymentOrModelName, + audioTranscriptionOptions, requestOptions); } /** @@ -1193,7 +1200,7 @@ Mono> getAudioTranscriptionAsPlainTextWithResponse(String d * * @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 body Body parameter. + * @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. @@ -1205,11 +1212,11 @@ Mono> getAudioTranscriptionAsPlainTextWithResponse(String d @Generated @ServiceMethod(returns = ReturnType.SINGLE) Mono> getAudioTranslationAsResponseObjectWithResponse(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + 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, body, - requestOptions); + return this.serviceClient.getAudioTranslationAsResponseObjectWithResponseAsync(deploymentOrModelName, + audioTranslationOptions, requestOptions); } /** @@ -1222,7 +1229,7 @@ Mono> getAudioTranslationAsResponseObjectWithResponse(Strin * * @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 body Body parameter. + * @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. @@ -1233,12 +1240,12 @@ Mono> getAudioTranslationAsResponseObjectWithResponse(Strin */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, BinaryData body, - RequestOptions requestOptions) { + Mono> getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, + BinaryData audioTranslationOptions, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation // 'getAudioTranslationAsPlainText' is 'multipart/form-data' - return this.serviceClient.getAudioTranslationAsPlainTextWithResponseAsync(deploymentOrModelName, body, - requestOptions); + return this.serviceClient.getAudioTranslationAsPlainTextWithResponseAsync(deploymentOrModelName, + audioTranslationOptions, requestOptions); } /** @@ -1407,7 +1414,7 @@ public Mono> getImageGenerationsWithResponse(String d * * @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 body Body parameter. + * @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. @@ -1418,11 +1425,12 @@ public Mono> getImageGenerationsWithResponse(String d */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getImageGenerations(String deploymentOrModelName, ImageGenerationOptions body) { + public Mono getImageGenerations(String deploymentOrModelName, + ImageGenerationOptions imageGenerationOptions) { // Generated convenience method for getImageGenerationsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getImageGenerationsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions) - .flatMap(FluxUtil::toMono) + return getImageGenerationsWithResponse(deploymentOrModelName, BinaryData.fromObject(imageGenerationOptions), + requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ImageGenerations.class)); } @@ -1521,7 +1529,8 @@ public Mono> generateSpeechFromTextWithResponse(String depl * * @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 body Body parameter. + * @param speechGenerationOptions A representation of the request options that control the behavior of a + * text-to-speech operation. * @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. @@ -1532,10 +1541,11 @@ public Mono> generateSpeechFromTextWithResponse(String depl */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono generateSpeechFromText(String deploymentOrModelName, SpeechGenerationOptions body) { + public Mono generateSpeechFromText(String deploymentOrModelName, + SpeechGenerationOptions speechGenerationOptions) { // Generated convenience method for generateSpeechFromTextWithResponse RequestOptions requestOptions = new RequestOptions(); - return generateSpeechFromTextWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions) - .flatMap(FluxUtil::toMono); + return generateSpeechFromTextWithResponse(deploymentOrModelName, BinaryData.fromObject(speechGenerationOptions), + requestOptions).flatMap(FluxUtil::toMono); } } 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 d4ba68570431..6d1c6542cdd0 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 @@ -547,7 +547,9 @@ public Response getChatCompletionsWithResponse(String deploymen * * @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 body Body parameter. + * @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. @@ -560,11 +562,11 @@ public Response getChatCompletionsWithResponse(String deploymen */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Embeddings getEmbeddings(String deploymentOrModelName, EmbeddingsOptions body) { + public Embeddings getEmbeddings(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions) { // Generated convenience method for getEmbeddingsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions).getValue() - .toObject(Embeddings.class); + return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(embeddingsOptions), + requestOptions).getValue().toObject(Embeddings.class); } /** @@ -574,7 +576,9 @@ public Embeddings getEmbeddings(String deploymentOrModelName, EmbeddingsOptions * * @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 body Body parameter. + * @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. @@ -587,11 +591,11 @@ public Embeddings getEmbeddings(String deploymentOrModelName, EmbeddingsOptions */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Completions getCompletions(String deploymentOrModelName, CompletionsOptions body) { + public Completions getCompletions(String deploymentOrModelName, CompletionsOptions completionsOptions) { // Generated convenience method for getCompletionsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions).getValue() - .toObject(Completions.class); + return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(completionsOptions), + requestOptions).getValue().toObject(Completions.class); } /** @@ -651,7 +655,9 @@ public IterableStream getCompletionsStream(String deploymentOrModel * * @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 body Body parameter. + * @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. @@ -664,12 +670,12 @@ public IterableStream getCompletionsStream(String deploymentOrModel */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ChatCompletions getChatCompletions(String deploymentOrModelName, ChatCompletionsOptions body) { + public ChatCompletions getChatCompletions(String deploymentOrModelName, + ChatCompletionsOptions chatCompletionsOptions) { // Generated convenience method for getChatCompletionsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getChatCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions) - .getValue() - .toObject(ChatCompletions.class); + return getChatCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions), + requestOptions).getValue().toObject(ChatCompletions.class); } /** @@ -1082,7 +1088,7 @@ public Response getAudioTranslationTextWithResponse(String deploymentOrM * * @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 body Body parameter. + * @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. @@ -1093,11 +1099,11 @@ public Response getAudioTranslationTextWithResponse(String deploymentOrM @Generated @ServiceMethod(returns = ReturnType.SINGLE) Response getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + 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, body, - requestOptions); + return this.serviceClient.getAudioTranscriptionAsResponseObjectWithResponse(deploymentOrModelName, + audioTranscriptionOptions, requestOptions); } /** @@ -1111,7 +1117,7 @@ Response getAudioTranscriptionAsResponseObjectWithResponse(String de * * @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 body Body parameter. + * @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. @@ -1121,12 +1127,12 @@ Response getAudioTranscriptionAsResponseObjectWithResponse(String de */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, BinaryData body, - RequestOptions requestOptions) { + Response getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation // 'getAudioTranscriptionAsPlainText' is 'multipart/form-data' - return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, body, - requestOptions); + return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName, + audioTranscriptionOptions, requestOptions); } /** @@ -1160,7 +1166,7 @@ Response getAudioTranscriptionAsPlainTextWithResponse(String deploym * * @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 body Body parameter. + * @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. @@ -1171,12 +1177,12 @@ Response getAudioTranscriptionAsPlainTextWithResponse(String deploym */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response getAudioTranslationAsResponseObjectWithResponse(String deploymentOrModelName, BinaryData body, - 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, body, - requestOptions); + return this.serviceClient.getAudioTranslationAsResponseObjectWithResponse(deploymentOrModelName, + audioTranslationOptions, requestOptions); } /** @@ -1189,7 +1195,7 @@ Response getAudioTranslationAsResponseObjectWithResponse(String depl * * @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 body Body parameter. + * @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. @@ -1200,12 +1206,12 @@ Response getAudioTranslationAsResponseObjectWithResponse(String depl */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - Response getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, BinaryData body, - RequestOptions requestOptions) { + Response getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, + BinaryData audioTranslationOptions, RequestOptions requestOptions) { // Protocol API requires serialization of parts with content-disposition and data, as operation // 'getAudioTranslationAsPlainText' is 'multipart/form-data' - return this.serviceClient.getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, body, - requestOptions); + return this.serviceClient.getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName, + audioTranslationOptions, requestOptions); } /** @@ -1368,7 +1374,7 @@ public Response getImageGenerationsWithResponse(String deploym * * @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 body Body parameter. + * @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. @@ -1379,12 +1385,12 @@ public Response getImageGenerationsWithResponse(String deploym */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ImageGenerations getImageGenerations(String deploymentOrModelName, ImageGenerationOptions body) { + public ImageGenerations getImageGenerations(String deploymentOrModelName, + ImageGenerationOptions imageGenerationOptions) { // Generated convenience method for getImageGenerationsWithResponse RequestOptions requestOptions = new RequestOptions(); - return getImageGenerationsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions) - .getValue() - .toObject(ImageGenerations.class); + return getImageGenerationsWithResponse(deploymentOrModelName, BinaryData.fromObject(imageGenerationOptions), + requestOptions).getValue().toObject(ImageGenerations.class); } /** @@ -1479,7 +1485,8 @@ public Response generateSpeechFromTextWithResponse(String deployment * * @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 body Body parameter. + * @param speechGenerationOptions A representation of the request options that control the behavior of a + * text-to-speech operation. * @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. @@ -1490,10 +1497,11 @@ public Response generateSpeechFromTextWithResponse(String deployment */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData generateSpeechFromText(String deploymentOrModelName, SpeechGenerationOptions body) { + public BinaryData generateSpeechFromText(String deploymentOrModelName, + SpeechGenerationOptions speechGenerationOptions) { // Generated convenience method for generateSpeechFromTextWithResponse RequestOptions requestOptions = new RequestOptions(); - return generateSpeechFromTextWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions) - .getValue(); + return generateSpeechFromTextWithResponse(deploymentOrModelName, BinaryData.fromObject(speechGenerationOptions), + requestOptions).getValue(); } } 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 8d810e97aee4..cff5e4295696 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 @@ -21,34 +21,14 @@ public enum OpenAIServiceVersion implements ServiceVersion { V2023_05_15("2023-05-15"), /** - * Enum value 2023-06-01-preview. + * Enum value 2024-02-01. */ - V2023_06_01_PREVIEW("2023-06-01-preview"), + V2024_02_01("2024-02-01"), /** - * Enum value 2023-07-01-preview. + * Enum value 2024-06-01. */ - V2023_07_01_PREVIEW("2023-07-01-preview"), - - /** - * Enum value 2024-02-15-preview. - */ - V2024_02_15_PREVIEW("2024-02-15-preview"), - - /** - * Enum value 2024-03-01-preview. - */ - V2024_03_01_PREVIEW("2024-03-01-preview"), - - /** - * Enum value 2024-04-01-preview. - */ - V2024_04_01_PREVIEW("2024-04-01-preview"), - - /** - * Enum value 2024-05-01-preview. - */ - V2024_05_01_PREVIEW("2024-05-01-preview"); + V2024_06_01("2024-06-01"); private final String version; @@ -70,6 +50,6 @@ public String getVersion() { * @return The latest {@link OpenAIServiceVersion}. */ public static OpenAIServiceVersion getLatest() { - return V2024_05_01_PREVIEW; + return V2024_06_01; } } 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 b1ae415bbbea..c6de4304f762 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 @@ -160,7 +160,8 @@ public interface OpenAIClientService { Mono> getAudioTranscriptionAsPlainText(@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 body, RequestOptions requestOptions, Context context); + @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/deployments/{deploymentId}/audio/transcriptions") @@ -172,7 +173,8 @@ Mono> getAudioTranscriptionAsPlainText(@HostParam("endpoint Response getAudioTranscriptionAsPlainTextSync(@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 body, RequestOptions requestOptions, Context context); + @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/deployments/{deploymentId}/audio/transcriptions") @@ -184,7 +186,8 @@ Response getAudioTranscriptionAsPlainTextSync(@HostParam("endpoint") 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 body, RequestOptions requestOptions, Context context); + @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/deployments/{deploymentId}/audio/transcriptions") @@ -196,7 +199,8 @@ Mono> getAudioTranscriptionAsResponseObject(@HostParam("end 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 body, RequestOptions requestOptions, Context context); + @BodyParam("multipart/form-data") BinaryData audioTranscriptionOptions, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/deployments/{deploymentId}/audio/translations") @@ -208,7 +212,8 @@ Response getAudioTranscriptionAsResponseObjectSync(@HostParam("endpo Mono> getAudioTranslationAsPlainText(@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 body, RequestOptions requestOptions, Context context); + @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/deployments/{deploymentId}/audio/translations") @@ -220,7 +225,8 @@ Mono> getAudioTranslationAsPlainText(@HostParam("endpoint") Response getAudioTranslationAsPlainTextSync(@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 body, RequestOptions requestOptions, Context context); + @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/deployments/{deploymentId}/audio/translations") @@ -232,7 +238,8 @@ Response getAudioTranslationAsPlainTextSync(@HostParam("endpoint") S 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 body, RequestOptions requestOptions, Context context); + @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, + Context context); // @Multipart not supported by RestProxy @Post("/deployments/{deploymentId}/audio/translations") @@ -244,7 +251,8 @@ Mono> getAudioTranslationAsResponseObject(@HostParam("endpo 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 body, RequestOptions requestOptions, Context context); + @BodyParam("multipart/form-data") BinaryData audioTranslationOptions, RequestOptions requestOptions, + Context context); @Post("/deployments/{deploymentId}/completions") @ExpectedResponses({ 200 }) @@ -254,7 +262,7 @@ Response getAudioTranslationAsResponseObjectSync(@HostParam("endpoin @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 body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/completions") @@ -265,7 +273,7 @@ Mono> getCompletions(@HostParam("endpoint") String endpoint @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 body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData completionsOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/chat/completions") @@ -276,7 +284,7 @@ Response getCompletionsSync(@HostParam("endpoint") String endpoint, @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 body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/chat/completions") @@ -287,7 +295,7 @@ Mono> getChatCompletions(@HostParam("endpoint") String endp @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 body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData chatCompletionsOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/images/generations") @@ -298,7 +306,7 @@ Response getChatCompletionsSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getImageGenerations(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/images/generations") @@ -309,7 +317,7 @@ Mono> getImageGenerations(@HostParam("endpoint") String end @UnexpectedResponseExceptionType(HttpResponseException.class) Response getImageGenerationsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData imageGenerationOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/audio/speech") @@ -320,7 +328,7 @@ Response getImageGenerationsSync(@HostParam("endpoint") String endpo @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> generateSpeechFromText(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData speechGenerationOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/audio/speech") @@ -331,7 +339,7 @@ Mono> generateSpeechFromText(@HostParam("endpoint") String @UnexpectedResponseExceptionType(HttpResponseException.class) Response generateSpeechFromTextSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("deploymentId") String deploymentOrModelName, - @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData speechGenerationOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/embeddings") @@ -342,7 +350,7 @@ Response generateSpeechFromTextSync(@HostParam("endpoint") String en @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 body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, Context context); @Post("/deployments/{deploymentId}/embeddings") @@ -353,7 +361,7 @@ Mono> getEmbeddings(@HostParam("endpoint") String endpoint, @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 body, + @HeaderParam("accept") String accept, @BodyParam("application/json") BinaryData embeddingsOptions, RequestOptions requestOptions, Context context); } @@ -368,7 +376,7 @@ Response getEmbeddingsSync(@HostParam("endpoint") String endpoint, * * @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 body Body parameter. + * @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. @@ -379,12 +387,12 @@ Response getEmbeddingsSync(@HostParam("endpoint") String endpoint, */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAudioTranscriptionAsPlainTextWithResponseAsync(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; final String accept = "text/plain, application/json"; return FluxUtil.withContext(context -> service.getAudioTranscriptionAsPlainText(this.getEndpoint(), - this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, body, requestOptions, - context)); + this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, + audioTranscriptionOptions, requestOptions, context)); } /** @@ -398,7 +406,7 @@ public Mono> getAudioTranscriptionAsPlainTextWithResponseAs * * @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 body Body parameter. + * @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. @@ -408,11 +416,11 @@ public Mono> getAudioTranscriptionAsPlainTextWithResponseAs */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + BinaryData audioTranscriptionOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; final String accept = "text/plain, application/json"; return service.getAudioTranscriptionAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, contentType, accept, body, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, audioTranscriptionOptions, requestOptions, Context.NONE); } /** @@ -454,7 +462,7 @@ public Response getAudioTranscriptionAsPlainTextWithResponse(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 body Body parameter. + * @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. @@ -465,12 +473,12 @@ public Response getAudioTranscriptionAsPlainTextWithResponse(String */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAudioTranscriptionAsResponseObjectWithResponseAsync( - String deploymentOrModelName, BinaryData body, RequestOptions requestOptions) { + 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, body, requestOptions, - context)); + this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, + audioTranscriptionOptions, requestOptions, context)); } /** @@ -512,7 +520,7 @@ public Mono> getAudioTranscriptionAsResponseObjectWithRespo * * @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 body Body parameter. + * @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. @@ -522,12 +530,12 @@ public Mono> getAudioTranscriptionAsResponseObjectWithRespo */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + 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, body, requestOptions, - Context.NONE); + this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, + audioTranscriptionOptions, requestOptions, Context.NONE); } /** @@ -540,7 +548,7 @@ public Response getAudioTranscriptionAsResponseObjectWithResponse(St * * @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 body Body parameter. + * @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. @@ -551,12 +559,12 @@ public Response getAudioTranscriptionAsResponseObjectWithResponse(St */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAudioTranslationAsPlainTextWithResponseAsync(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + BinaryData audioTranslationOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; final String accept = "text/plain, application/json"; return FluxUtil.withContext( context -> service.getAudioTranslationAsPlainText(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, contentType, accept, body, requestOptions, context)); + deploymentOrModelName, contentType, accept, audioTranslationOptions, requestOptions, context)); } /** @@ -569,7 +577,7 @@ public Mono> getAudioTranslationAsPlainTextWithResponseAsyn * * @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 body Body parameter. + * @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. @@ -580,11 +588,11 @@ public Mono> getAudioTranslationAsPlainTextWithResponseAsyn */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + BinaryData audioTranslationOptions, RequestOptions requestOptions) { final String contentType = "multipart/form-data"; final String accept = "text/plain, application/json"; return service.getAudioTranslationAsPlainTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, contentType, accept, body, requestOptions, Context.NONE); + deploymentOrModelName, contentType, accept, audioTranslationOptions, requestOptions, Context.NONE); } /** @@ -618,7 +626,7 @@ public Response getAudioTranslationAsPlainTextWithResponse(String de * * @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 body Body parameter. + * @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. @@ -629,12 +637,12 @@ public Response getAudioTranslationAsPlainTextWithResponse(String de */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getAudioTranslationAsResponseObjectWithResponseAsync(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + 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, body, requestOptions, - context)); + this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranslationOptions, + requestOptions, context)); } /** @@ -668,7 +676,7 @@ public Mono> getAudioTranslationAsResponseObjectWithRespons * * @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 body Body parameter. + * @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. @@ -679,12 +687,12 @@ public Mono> getAudioTranslationAsResponseObjectWithRespons */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getAudioTranslationAsResponseObjectWithResponse(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + 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, body, requestOptions, - Context.NONE); + this.getServiceVersion().getVersion(), deploymentOrModelName, contentType, accept, audioTranslationOptions, + requestOptions, Context.NONE); } /** @@ -816,7 +824,9 @@ public Response getAudioTranslationAsResponseObjectWithResponse(Stri * * @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 body Body parameter. + * @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. @@ -827,11 +837,12 @@ public Response getAudioTranslationAsResponseObjectWithResponse(Stri * provided prompt data along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCompletionsWithResponseAsync(String deploymentOrModelName, BinaryData body, - RequestOptions requestOptions) { + 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, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, completionsOptions, requestOptions, context)); } /** @@ -963,7 +974,9 @@ public Mono> getCompletionsWithResponseAsync(String deploym * * @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 body Body parameter. + * @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. @@ -974,11 +987,11 @@ public Mono> getCompletionsWithResponseAsync(String deploym * provided prompt data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCompletionsWithResponse(String deploymentOrModelName, BinaryData body, + public Response getCompletionsWithResponse(String deploymentOrModelName, BinaryData completionsOptions, RequestOptions requestOptions) { final String accept = "application/json"; return service.getCompletionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, body, requestOptions, Context.NONE); + deploymentOrModelName, accept, completionsOptions, requestOptions, Context.NONE); } /** @@ -1214,7 +1227,9 @@ public Response getCompletionsWithResponse(String deploymentOrModelN * * @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 body Body parameter. + * @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. @@ -1225,11 +1240,12 @@ public Response getCompletionsWithResponse(String deploymentOrModelN * provided prompt data along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getChatCompletionsWithResponseAsync(String deploymentOrModelName, BinaryData body, - 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, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getChatCompletions(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, chatCompletionsOptions, requestOptions, context)); } /** @@ -1465,7 +1481,9 @@ public Mono> getChatCompletionsWithResponseAsync(String dep * * @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 body Body parameter. + * @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. @@ -1476,11 +1494,11 @@ public Mono> getChatCompletionsWithResponseAsync(String dep * provided prompt data along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getChatCompletionsWithResponse(String deploymentOrModelName, BinaryData body, - 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, body, requestOptions, Context.NONE); + deploymentOrModelName, accept, chatCompletionsOptions, requestOptions, Context.NONE); } /** @@ -1546,7 +1564,7 @@ public Response getChatCompletionsWithResponse(String deploymentOrMo * * @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 body Body parameter. + * @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. @@ -1557,10 +1575,11 @@ public Response getChatCompletionsWithResponse(String deploymentOrMo */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getImageGenerationsWithResponseAsync(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + BinaryData imageGenerationOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getImageGenerations(this.getEndpoint(), - this.getServiceVersion().getVersion(), deploymentOrModelName, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.getImageGenerations(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, imageGenerationOptions, requestOptions, context)); } /** @@ -1626,7 +1645,7 @@ public Mono> getImageGenerationsWithResponseAsync(String de * * @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 body Body parameter. + * @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. @@ -1635,11 +1654,11 @@ public Mono> getImageGenerationsWithResponseAsync(String de * @return the result of a successful image generation operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getImageGenerationsWithResponse(String deploymentOrModelName, BinaryData body, - RequestOptions requestOptions) { + public Response getImageGenerationsWithResponse(String deploymentOrModelName, + BinaryData imageGenerationOptions, RequestOptions requestOptions) { final String accept = "application/json"; return service.getImageGenerationsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, body, requestOptions, Context.NONE); + deploymentOrModelName, accept, imageGenerationOptions, requestOptions, Context.NONE); } /** @@ -1664,7 +1683,8 @@ public Response getImageGenerationsWithResponse(String deploymentOrM * * @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 body Body parameter. + * @param speechGenerationOptions A representation of the request options that control the behavior of a + * text-to-speech operation. * @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. @@ -1674,10 +1694,11 @@ public Response getImageGenerationsWithResponse(String deploymentOrM */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> generateSpeechFromTextWithResponseAsync(String deploymentOrModelName, - BinaryData body, RequestOptions requestOptions) { + BinaryData speechGenerationOptions, RequestOptions requestOptions) { final String accept = "application/octet-stream, application/json"; - return FluxUtil.withContext(context -> service.generateSpeechFromText(this.getEndpoint(), - this.getServiceVersion().getVersion(), deploymentOrModelName, accept, body, requestOptions, context)); + return FluxUtil.withContext( + context -> service.generateSpeechFromText(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, speechGenerationOptions, requestOptions, context)); } /** @@ -1702,7 +1723,8 @@ public Mono> generateSpeechFromTextWithResponseAsync(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 body Body parameter. + * @param speechGenerationOptions A representation of the request options that control the behavior of a + * text-to-speech operation. * @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. @@ -1711,11 +1733,11 @@ public Mono> generateSpeechFromTextWithResponseAsync(String * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response generateSpeechFromTextWithResponse(String deploymentOrModelName, BinaryData body, - RequestOptions requestOptions) { + public Response generateSpeechFromTextWithResponse(String deploymentOrModelName, + BinaryData speechGenerationOptions, RequestOptions requestOptions) { final String accept = "application/octet-stream, application/json"; return service.generateSpeechFromTextSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, body, requestOptions, Context.NONE); + deploymentOrModelName, accept, speechGenerationOptions, requestOptions, Context.NONE); } /** @@ -1756,7 +1778,9 @@ public Response generateSpeechFromTextWithResponse(String deployment * * @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 body Body parameter. + * @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. @@ -1768,11 +1792,12 @@ public Response generateSpeechFromTextWithResponse(String deployment * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getEmbeddingsWithResponseAsync(String deploymentOrModelName, BinaryData body, - RequestOptions requestOptions) { + public Mono> getEmbeddingsWithResponseAsync(String deploymentOrModelName, + BinaryData embeddingsOptions, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getEmbeddings(this.getEndpoint(), - this.getServiceVersion().getVersion(), deploymentOrModelName, accept, body, requestOptions, context)); + return FluxUtil + .withContext(context -> service.getEmbeddings(this.getEndpoint(), this.getServiceVersion().getVersion(), + deploymentOrModelName, accept, embeddingsOptions, requestOptions, context)); } /** @@ -1813,7 +1838,9 @@ public Mono> getEmbeddingsWithResponseAsync(String deployme * * @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 body Body parameter. + * @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. @@ -1824,10 +1851,10 @@ public Mono> getEmbeddingsWithResponseAsync(String deployme * recommendations, and other similar scenarios along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getEmbeddingsWithResponse(String deploymentOrModelName, BinaryData body, + public Response getEmbeddingsWithResponse(String deploymentOrModelName, BinaryData embeddingsOptions, RequestOptions requestOptions) { final String accept = "application/json"; return service.getEmbeddingsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), - deploymentOrModelName, accept, body, requestOptions, Context.NONE); + deploymentOrModelName, accept, embeddingsOptions, requestOptions, Context.NONE); } } diff --git a/sdk/openai/azure-ai-openai/tsp-location.yaml b/sdk/openai/azure-ai-openai/tsp-location.yaml index d730c0b9f3a0..065981cfdc38 100644 --- a/sdk/openai/azure-ai-openai/tsp-location.yaml +++ b/sdk/openai/azure-ai-openai/tsp-location.yaml @@ -1,5 +1,4 @@ directory: specification/cognitiveservices/OpenAI.Inference -additionalDirectories: - - specification/cognitiveservices/OpenAI.Authoring -commit: df3cd3e3d50eec1d1da593750e1ea3a4db3f541d +commit: 3c2c34f9c90b651bc4647c4f9e2e97d1a8345683 repo: Azure/azure-rest-api-specs +additionalDirectories: