Skip to content

Commit

Permalink
CodeGen from PR 29483 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge eed58b837ff16ca27ab5a6ef4a42e5fe0c8a61e6 into 2b6c728b10f0d8eca8bad4e7f009e38334ea7f1c
  • Loading branch information
SDKAuto committed Jun 26, 2024
1 parent 3b4e736 commit 53eb9c5
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 159 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,7 @@ public Flux<Response<ChatCompletions>> 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 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 body Body parameter.
* @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.
Expand All @@ -633,11 +631,11 @@ public Flux<Response<ChatCompletions>> getChatCompletionsStreamWithResponse(Stri
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Embeddings> getEmbeddings(String deploymentOrModelName, EmbeddingsOptions embeddingsOptions) {
public Mono<Embeddings> getEmbeddings(String deploymentOrModelName, EmbeddingsOptions body) {
// Generated convenience method for getEmbeddingsWithResponse
RequestOptions requestOptions = new RequestOptions();
return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(embeddingsOptions),
requestOptions).flatMap(FluxUtil::toMono)
return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions)
.flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(Embeddings.class));
}

Expand All @@ -648,9 +646,7 @@ public Mono<Embeddings> 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 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 body Body parameter.
* @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.
Expand All @@ -663,11 +659,11 @@ public Mono<Embeddings> getEmbeddings(String deploymentOrModelName, EmbeddingsOp
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Completions> getCompletions(String deploymentOrModelName, CompletionsOptions completionsOptions) {
public Mono<Completions> getCompletions(String deploymentOrModelName, CompletionsOptions body) {
// Generated convenience method for getCompletionsWithResponse
RequestOptions requestOptions = new RequestOptions();
return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(completionsOptions),
requestOptions).flatMap(FluxUtil::toMono)
return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions)
.flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(Completions.class));
}

Expand Down Expand Up @@ -837,7 +833,7 @@ public Flux<ChatCompletions> 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 audioTranscriptionOptions The configuration information for an audio transcription request.
* @param body Body parameter.
* @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.
Expand All @@ -849,11 +845,11 @@ public Flux<ChatCompletions> getChatCompletionsStream(String deploymentOrModelNa
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<BinaryData>> getAudioTranscriptionAsResponseObjectWithResponse(String deploymentOrModelName,
BinaryData audioTranscriptionOptions, RequestOptions requestOptions) {
BinaryData body, 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, body,
requestOptions);
}

/**
Expand Down Expand Up @@ -1150,7 +1146,7 @@ public Mono<Response<String>> 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 audioTranscriptionOptions The configuration information for an audio transcription request.
* @param body Body parameter.
* @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.
Expand All @@ -1162,11 +1158,11 @@ public Mono<Response<String>> getAudioTranslationTextWithResponse(String deploym
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<BinaryData>> getAudioTranscriptionAsPlainTextWithResponse(String deploymentOrModelName,
BinaryData audioTranscriptionOptions, RequestOptions requestOptions) {
BinaryData body, 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,
audioTranscriptionOptions, requestOptions);
return this.serviceClient.getAudioTranscriptionAsPlainTextWithResponseAsync(deploymentOrModelName, body,
requestOptions);
}

/**
Expand Down Expand Up @@ -1200,7 +1196,7 @@ Mono<Response<BinaryData>> 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 audioTranslationOptions The configuration information for an audio translation request.
* @param body Body parameter.
* @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.
Expand All @@ -1212,11 +1208,11 @@ Mono<Response<BinaryData>> getAudioTranscriptionAsPlainTextWithResponse(String d
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<BinaryData>> getAudioTranslationAsResponseObjectWithResponse(String deploymentOrModelName,
BinaryData audioTranslationOptions, RequestOptions requestOptions) {
BinaryData body, 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, body,
requestOptions);
}

/**
Expand All @@ -1229,7 +1225,7 @@ Mono<Response<BinaryData>> 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 audioTranslationOptions The configuration information for an audio translation request.
* @param body Body parameter.
* @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.
Expand All @@ -1240,12 +1236,12 @@ Mono<Response<BinaryData>> getAudioTranslationAsResponseObjectWithResponse(Strin
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
Mono<Response<BinaryData>> getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName,
BinaryData audioTranslationOptions, RequestOptions requestOptions) {
Mono<Response<BinaryData>> getAudioTranslationAsPlainTextWithResponse(String deploymentOrModelName, BinaryData body,
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,
audioTranslationOptions, requestOptions);
return this.serviceClient.getAudioTranslationAsPlainTextWithResponseAsync(deploymentOrModelName, body,
requestOptions);
}

/**
Expand Down Expand Up @@ -1381,7 +1377,7 @@ Mono<Response<ImageGenerations>> getImageGenerationsWithResponse(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 imageGenerationOptions Represents the request data used to generate images.
* @param body Body parameter.
* @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.
Expand All @@ -1392,12 +1388,11 @@ Mono<Response<ImageGenerations>> getImageGenerationsWithResponse(String deployme
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<ImageGenerations> getImageGenerations(String deploymentOrModelName,
ImageGenerationOptions imageGenerationOptions) {
public Mono<ImageGenerations> getImageGenerations(String deploymentOrModelName, ImageGenerationOptions body) {
// Generated convenience method for getImageGenerationsWithResponse
RequestOptions requestOptions = new RequestOptions();
return getImageGenerationsWithResponse(deploymentOrModelName, BinaryData.fromObject(imageGenerationOptions),
requestOptions).flatMap(FluxUtil::toMono)
return getImageGenerationsWithResponse(deploymentOrModelName, BinaryData.fromObject(body), requestOptions)
.flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ImageGenerations.class));
}

Expand Down
Loading

0 comments on commit 53eb9c5

Please sign in to comment.