Skip to content

How to access AnnotationContent with OpenAI assistant, streaming mode in c# #9327

Answered by crickman
JP-droidic asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @JP-droidic - I don't believe we have a sample in the repo that combines file-search with streaming for the assistant-agent. We have, however, recently published a few examples to our learn-site documentation that covers this:

https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/examples/example-assistant-search?pivots=programming-language-csharp

In this example, the StreamingAnnotationContent is being incrementally added to a list to that it may be rendered as foot-notes to the response:

List<StreamingAnnotationContent> footnotes = [];
await foreach (StreamingChatMessageContent chunk in agent.InvokeStreamingAsync(threadId))
{
    // Capture annotations for footnotes

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JP-droidic
Comment options

Answer selected by JP-droidic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested .NET Issue or Pull requests regarding .NET code experimental Associated with an experimental feature agents
3 participants