semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

.Net: Bug: OpenAiResponseAgent chat message images removed by SK

Open shravan2x opened this issue 1 year ago • 3 comments

Describe the bug It appears that SK currently removes any ImageContent in a user message before it's sent to OpenAI. The offending code seems to be this ToResponseItem call. The implementation of this method only retains the main chat string and ignores all items.

Pseudocode:

ChatMessageContent userMessage = new ChatMessageContent(AuthorRole.User, "describe the image");
userMessage.Items.Add(new ImageContent(imageUri));
await foreach (AgentResponseItem<ChatMessageContent> response in agent.InvokeAsync(userMessage))
{
 // ...
}

Platform

  • Language: C#
  • Source: NuGet package version 1.61.0
  • AI model: o3-pro

shravan2x avatar Aug 07 '25 18:08 shravan2x

+1 to this bug. It doesnt process any KernelContent that doesn't have an message.Content (string). So all other Kernel Content that isnt TextContent (Binary, Image, etc) are all ignored

justinbarias avatar Aug 22 '25 01:08 justinbarias

Can someone have a look at this issue please, this is a big showstopper for moving responses API to production

JP-droidic avatar Aug 25 '25 18:08 JP-droidic

This breaks Responses when the ChatHistory has FunctionCall or FunctionCallResponse (Or anything that isnt the 4 content parts)

DanielMcAssey avatar Sep 22 '25 16:09 DanielMcAssey