azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[BUG] Azure.AI.OpenAI: Requesting 'Echo' and 'LogProbs' at the same time breaks results
Library name and version
Azure.AI.OpenAI 1.0.0-beta.1
Describe the bug
Configuring a Completions request such that it asks for Echo (include the prompt in the response) and LogProbs at the same time induces a result payload that fails to deserialize in the generated code.
Expected behavior
Getting a Completions result with Echo == true
and LogProbability != 0
should not throw an exception and the null item should either be omitted or represented as a default/empty mapping in the object model.
Actual behavior
Setting Echo = true
and LogProbability = <something other than 0>
on a CompletionsOptions
causes an exception to be thrown when creating the Completions
result.
Reproduction Steps
Run code like the following:
OpenAIClient client = GetClient();
CompletionsOptions requestOptions = new CompletionsOptions()
{
Prompt = { "Hello world" },
Echo = true,
LogProbability = 1,
};
Response<Completions> response = await client.GetCompletionsAsync(
CompletionsDeploymentId,
requestOptions);
Environment
Windows, .NET 7 from the .NET CLI or VS2022; issue is platform-independent
@jpalvarezl FYI
Thank you for your feedback. Tagging and routing to the team member best able to assist.
I believe this is related to https://github.com/Azure/autorest.csharp/issues/3084 and might be a duplicate
You are correct! Addressing that feature request will enable us to write the spec in a way that allows to correct this bug.
For the sake of clarity: this bug stems from token_logprobs
containing a null
JSON value as a result of setting up the request like @trrwilson described.