We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1dfbf0 commit 2130f36Copy full SHA for 2130f36
src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIAssistantsChatClient.cs
@@ -245,6 +245,12 @@ public async IAsyncEnumerable<ChatResponseUpdate> GetStreamingResponseAsync(
245
246
if (fileId is not null)
247
{
248
+ if (textUpdate.Contents.Count == 0)
249
+ {
250
+ // In case a chunk doesn't have text content, create one with empty text to hold the annotation.
251
+ textUpdate.Contents.Add(new TextContent(string.Empty));
252
+ }
253
+
254
(((TextContent)textUpdate.Contents[0]).Annotations ??= []).Add(new CitationAnnotation
255
256
RawRepresentation = tau,
0 commit comments