Skip to content

Commit 90d158c

Browse files
authored
.Net: fix: fix issues with fileId (#13197)
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [x] I didn't break anyone 😄 fixes #13193
1 parent 814e236 commit 90d158c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dotnet/src/Agents/OpenAI/Internal/AssistantThreadActions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ private static ChatMessageContent GenerateMessageContent(string? assistantName,
624624
}
625625
}
626626
// Process image content
627-
else if (itemContent.ImageFileId != null)
627+
else if (!string.IsNullOrEmpty(itemContent.ImageFileId))
628628
{
629629
content.Items.Add(new FileReferenceContent(itemContent.ImageFileId));
630630
}
@@ -649,7 +649,7 @@ private static StreamingChatMessageContent GenerateStreamingMessageContent(strin
649649
content.Items.Add(new StreamingTextContent(update.Text));
650650
}
651651
// Process image content
652-
else if (update.ImageFileId != null)
652+
else if (!string.IsNullOrEmpty(update.ImageFileId))
653653
{
654654
content.Items.Add(new StreamingFileReferenceContent(update.ImageFileId));
655655
}
@@ -695,7 +695,7 @@ private static StreamingChatMessageContent GenerateStreamingMessageContent(strin
695695
{
696696
foreach (var output in update.CodeInterpreterOutputs!)
697697
{
698-
if (output.ImageFileId != null)
698+
if (!string.IsNullOrEmpty(output.ImageFileId))
699699
{
700700
content.Items.Add(new StreamingFileReferenceContent(output.ImageFileId));
701701
}

0 commit comments

Comments
 (0)