How to Retrieve Citations Using Azure OpenAI Client's 'Async with Streaming' Approach in .NET?
Ganesh Penke
5
Reputation points
I am using the Azure OpenAI client in .NET to retrieve responses based on 'Use your own data'. I'm successfully receiving responses in a streaming manner, but I'm encountering difficulty in retrieving citations using the 'Async with streaming' approach, which is available in the non-streaming response.
await foreach (StreamingChatCompletionsUpdate chatUpdate in client.GetChatCompletionsStreaming(chatCompletionsOptions))
{
if (chatUpdate.Role.HasValue)
{
Console.Write($"{chatUpdate.Role.Value.ToString().ToUpperInvariant()}: ");
}
if (!string.IsNullOrEmpty(chatUpdate.ContentUpdate))
{
Console.Write(chatUpdate.ContentUpdate);
}
}
Is there any solution available to help me retrieve citations using the streaming approach?
Sign in to answer