Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.18k stars 4.54k forks source link

[BUG] Appears to be no way to get base64 response from dall-e-3 requests #41036

Open brettjenkins opened 6 months ago

brettjenkins commented 6 months ago

Library name and version

Azure.AI.OpenAI 1.0.0-beta.12

Describe the bug

Unless I'm missing something, there appears to be no way to set the ResponseFormat to b64_json using the Azure.AI.OpenAI package when using dall-e. The ResponseFormat is internal on ImageGenerationOptions:

https://github.com/Azure/azure-sdk-for-net/blob/a4f73c0474e64454f76cfecf4691548d73ce2ee7/sdk/openai/Azure.AI.OpenAI/src/Custom/ImageGenerationOptions.cs#L24-L28

There's a comment that says this will be handled by using unique method signatures, but unless I'm missing something, I'm not seeing any unique method signature to use base64

https://github.com/Azure/azure-sdk-for-net/blob/a4f73c0474e64454f76cfecf4691548d73ce2ee7/sdk/openai/Azure.AI.OpenAI/src/Custom/OpenAIClient.cs#L579-L679

So is this a bug, or am I missing something?

Expected behavior

To either be able to set ResponseFormat in the ImageGenerationOptions or to have a method that differs which sets it for you

Actual behavior

There isn't either, so Base64Data is always null on response

Reproduction Steps

var imageGenerations = await client.GetImageGenerationsAsync(
        new ImageGenerationOptions()
        {
            Prompt = imagePrompt,
            DeploymentName = "dall-e-3",
            Size = ImageSize.Size1792x1024,
        }).ConfigureAwait(false);

    var images = imageGenerations.Value.Data.Select(a => a.Base64Data).ToList(); // all null

Environment

.NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.6c33ef20

Runtime Environment: OS Name: Windows OS Version: 10.0.22631 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\8.0.100\

Using Jetbrains Rider 2023.3

github-actions[bot] commented 6 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.

github-actions[bot] commented 6 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jpalvarezl @trrwilson.

vman commented 2 months ago

I am facing the same problem. I want to use the base64data from the .NET SDK for dalle 3 but not able to configure the ResponseFormat option.

Using 1.0.0-beta.13 version of the SDK.

vandana2015 commented 1 month ago

I am facing same issue. Any ETA?