Skip to content

.Net Bug: StreamingAnnotationContent isn't populated for AI Agent Service Internet Tool #11635

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

Open
davidames opened this issue Apr 18, 2025 · 1 comment
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code

Comments

@davidames
Copy link

Describe the bug
When using the Internet Search Tool with the AI Agent Service, citations are returned via the StreamingAnnotationContent class. This class is mostly empty and does not contain any useful information such as the citation URL.

To Reproduce
Steps to reproduce the behavior:

  1. Create an AI in the AI Agent Service, with a Grounding with Bing tool.
  2. As a question that invokes the Grounding with Bing tool
  3. Inspect the StreamingAnnotationContent that is returned in the response

  [Fact]
    [Experimental("OPENAI001")]
    public async Task InternetSearchFlattened()
    {
        var foundryConfig = GetService<AiFoundryConfig>();
        var client = AzureAIAgent.CreateAzureAIClient(foundryConfig.ConnectionString, new DefaultAzureCredential());
        var agentsClient = client.GetAgentsClient();
        var getAgentResponse =  await agentsClient.GetAgentAsync(AgentId);

        AzureAIAgent  agent = new(getAgentResponse.Value, agentsClient);
        AgentThread thread = new AzureAIAgentThread(agentsClient);
        
        await foreach (var responseUpdate in agent.InvokeStreamingAsync("What are today's news headlines", thread))
        {
            Logger.Debug("Streaming chunk: {Chunk}", responseUpdate.Message.Content);
            
            if (responseUpdate.Message.Items.Any())
            {
                foreach (var item in responseUpdate.Message.Items)
                {
                    if (item is StreamingAnnotationContent annotationContent)
                    {
                        Logger.Information("Citation Content {InnerContent}:", annotationContent.InnerContent);
                    }
                }
            }

            
        }
    }
    

Expected behavior
There should be way to get the citation URL and page title.

Screenshots

Image

Image

Platform

  • Language: C#
  • Source: Microsoft.SemanticKernel 1.47
  • AI model: gpt4 2024-08-06
  • IDE: Rider
  • OS: Windows

Additional context
Add any other context about the problem here.

@davidames davidames added the bug Something isn't working label Apr 18, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Apr 18, 2025
@github-actions github-actions bot changed the title .NET Bug: StreamingAnnotationContent isn't populated for AI Agent Service Internet Tool .Net Bug: StreamingAnnotationContent isn't populated for AI Agent Service Internet Tool Apr 18, 2025
@markharrison
Copy link

I have a similar / maybe connected issue - if my Agent is using Azure AI Search for its Knowledge ... the returned AnnotationContent is missing UrlCitation information

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code
Projects
Status: No status
Development

No branches or pull requests

4 participants