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

[BUG] Azure.AI.OpenAI beta.12: AzureExtensionsContext.Messages doesn't return citations since Jan. 12th, 2024 #41241

Open
freistli opened this issue Jan 13, 2024 · 6 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@freistli
Copy link
Member

Library name and version

Azure.AI.OpenAI beta.12

Describe the bug

With below code:

 Response<ChatCompletions> response = await client.GetChatCompletionsAsync(chatCompletionsOptions);

 ChatResponseMessage responseMessage = response.Value.Choices[0].Message;

responseMessage.Content includes correct responses from GPT-4 turbo, but responseMessage.AzureExtensionsContext.Messages doesn't have any citation now.

The problem starts happening since Jan, 12th, 2024, without code changing.

Before this problem happens, AOAI caused APIKey error from Jan. 11st 2024, but after around 48 hours it was recovered by itself. The bug was reported in #41138

This bug seems still related to AOAI changes (unknown) because code and library are the same.

Expected behavior

AzureExtensionsContext.Messages contains citations info as before

Actual behavior

The count in AzureExtensionsContext.Messages.Citations is 0 even the response is meaningful and have reference numbers [docN]

Reproduction Steps

 Response<ChatCompletions> response = await client.GetChatCompletionsAsync(chatCompletionsOptions);

 ChatResponseMessage responseMessage = response.Value.Choices[0].Message;

if (responseMessage.AzureExtensionsContext.Messages?.Count > 0)
 {
    ...
}
else
{
Console.WriteLine("No citations or other information.");
}

Environment

AOAI service,
GPT-4 turbo,
West US location,
Azure.AI.OpenAI beta.12 nuget.

@LucGosso
Copy link

Reproduction Steps, Complete example with azure search endpoints

` AzureCognitiveSearchChatExtensionConfiguration extensionConfig = new()
{
SearchEndpoint = new Uri(_configuration["AzureSearchServiceEndpoint"] + ""),
Authentication = new OnYourDataApiKeyAuthenticationOptions(_configuration["AzureSearchServiceApiKey"]),
IndexName = _configuration["AzureSearchIndex"],
DocumentCount = 10,
//Key = _configuration["AzureSearchServiceApiKey"],
/FieldMappingOptions = new AzureCognitiveSearchIndexFieldMappingOptions()
{
ContentFieldNames = { "content" },
TitleFieldName = "metadata_storage_name",
UrlFieldName = "url",
FilepathFieldName = "metadata_storage_name"
}
/
};
var chatCompletionsOptions = new ChatCompletionsOptions()
{
DeploymentName = _configuration["AzureOpenAiChatGptDeployment"],
Messages =
{
//new ChatRequestSystemMessage(promptTemplate),
new ChatRequestUserMessage(question),
},
// The addition of AzureChatExtensionsOptions enables the use of Azure OpenAI capabilities that add to
// the behavior of Chat Completions, here the "using your own data" feature to supplement the context
// with information from an Azure AI Search resource with documents that have been indexed.
AzureExtensionsOptions = new AzureChatExtensionsOptions()
{
Extensions = { extensionConfig }
}
};

Response response = await client.GetChatCompletionsAsync(chatCompletionsOptions);

ChatResponseMessage responseMessage = response.Value.Choices[0].Message;

if (responseMessage.AzureExtensionsContext.Messages?.Count > 0)
{
...
}
else
{
Console.WriteLine("No citations or other information.");
}
`

@thesnake666
Copy link

Yes, confirm, the result is ok for content but the citations field is null

@jsquire jsquire added Service Attention Workflow: This issue is responsible by Azure service team. Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Jan 13, 2024
Copy link

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

@jsquire jsquire added customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jan 13, 2024
Copy link

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

@andrej-melicher
Copy link

andrej-melicher commented Jan 13, 2024

same issue here, as seen on debug screenshot

image

when using REST API in Postman against same resource, the response is fine, including citations

image

@freistli
Copy link
Member Author

freistli commented Jan 15, 2024

The issue was auto recovered just now. I can get citations again with the same .Net nuget.

Even though, the .Net version still needs to fix this as REST API or Python client were not impacted by the same issue at the same time even AOAI experienced some unknown behavior changes in past 24 hours.

We don't know when AOAI runs into the same situation and impacts .Net nuget again.

The same suggestion to #41138

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team OpenAI question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants