AgentRunResponse.Messages Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the collection of messages to be represented by this response.
public System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> Messages { get; set; }
member this.Messages : System.Collections.Generic.IList<Microsoft.Extensions.AI.ChatMessage> with get, set
Public Property Messages As IList(Of ChatMessage)
Property Value
A collection of ChatMessage instances representing the agent's response.
If the backing collection is null, accessing this property will create an empty list.
Remarks
This property provides access to all messages generated during the agent's execution. While most responses contain a single assistant message, complex agent behaviors may produce multiple messages showing intermediate steps, function calls, or different types of content.
The collection is mutable and can be modified after creation. Setting this property to null will cause subsequent access to return an empty list.