ItemMessageExtensions.GetContentExpanded(ItemMessage) Method

Definition

Expands the Content BinaryData into a typed list of MessageContent objects. A plain JSON string is wrapped as a MessageContentInputTextContent. A JSON array is deserialized element-by-element via MessageContent polymorphic deserialization.

public static System.Collections.Generic.List<Azure.AI.AgentServer.Responses.Models.MessageContent> GetContentExpanded(this Azure.AI.AgentServer.Responses.Models.ItemMessage message);
static member GetContentExpanded : Azure.AI.AgentServer.Responses.Models.ItemMessage -> System.Collections.Generic.List<Azure.AI.AgentServer.Responses.Models.MessageContent>
<Extension()>
Public Function GetContentExpanded (message As ItemMessage) As List(Of MessageContent)

Parameters

message
ItemMessage

The item message to expand content from.

Returns

A list of deserialized content parts, or an empty list if content is null.

Exceptions

message is null.

The content BinaryData contains a JSON value that is neither a string nor an array. Message: "Expected JSON array or string for item content".

Applies to