Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-ai-openai] use body root to specify which parameter models we want to keep grouped #10921

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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