Skip to content

[BUG] The visibility of getImageGenerationsWithResponse should be public #46101

@sunyuhan1998

Description

@sunyuhan1998

Describe the bug

The interface com.azure.ai.openai.OpenAIAsyncClient#getImageGenerationsWithResponse(java.lang.String, com.azure.core.util.BinaryData, com.azure.core.http.rest.RequestOptions) currently uses the default visibility, which is protected.

Mono<Response<BinaryData>> getImageGenerationsWithResponse(String deploymentOrModelName,
BinaryData imageGenerationOptions, RequestOptions requestOptions) {
return this.openAIServiceClient != null
? this.openAIServiceClient.getImageGenerationsWithResponseAsync(deploymentOrModelName,
imageGenerationOptions, requestOptions)
: this.serviceClient.getImageGenerationsWithResponseAsync(deploymentOrModelName, imageGenerationOptions,
requestOptions);

I believe it should be public, as this is inconsistent with other similar interfaces, such as:

com.azure.ai.openai.OpenAIClient#getChatCompletionsWithResponse(java.lang.String, com.azure.core.util.BinaryData, com.azure.core.http.rest.RequestOptions):

public Response<BinaryData> getChatCompletionsWithResponse(String deploymentOrModelName,
BinaryData chatCompletionsOptions, RequestOptions requestOptions) {
return openAIServiceClient != null
? openAIServiceClient.getChatCompletionsWithResponse(deploymentOrModelName, chatCompletionsOptions,
requestOptions)
: serviceClient.getChatCompletionsWithResponse(deploymentOrModelName, chatCompletionsOptions,
requestOptions);
}

com.azure.ai.openai.OpenAIClient#getEmbeddingsWithResponse(java.lang.String, com.azure.core.util.BinaryData, com.azure.core.http.rest.RequestOptions):

public Response<BinaryData> getEmbeddingsWithResponse(String deploymentOrModelName, BinaryData embeddingsOptions,
RequestOptions requestOptions) {
final BinaryData embeddingsOptionsUpdated = addEncodingFormat(embeddingsOptions);
return openAIServiceClient != null
? openAIServiceClient.getEmbeddingsWithResponse(deploymentOrModelName, embeddingsOptionsUpdated,
requestOptions)
: serviceClient.getEmbeddingsWithResponse(deploymentOrModelName, embeddingsOptionsUpdated, requestOptions);
}

and com.azure.ai.openai.OpenAIClient#getAudioTranscriptionWithResponse:

public Response<AudioTranscription> getAudioTranscriptionWithResponse(String deploymentOrModelName, String fileName,
AudioTranscriptionOptions audioTranscriptionOptions, RequestOptions requestOptions) {
// checking allowed formats for a JSON response
validateAudioResponseFormatForTranscription(audioTranscriptionOptions);
// embedding the `model` in the request for non-Azure case
if (this.openAIServiceClient != null) {

Metadata

Metadata

Assignees

Labels

OpenAIcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions