MessageInjectingChatClient.GetPendingMessages(AgentSession) Method

Definition

Gets a snapshot of the pending injected messages for the specified session.

public System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> GetPendingMessages(Microsoft.Agents.AI.AgentSession session);
member this.GetPendingMessages : Microsoft.Agents.AI.AgentSession -> System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage>
Public Function GetPendingMessages (session As AgentSession) As IReadOnlyList(Of ChatMessage)

Parameters

session
AgentSession

The agent session to check.

Returns

A read-only list of pending messages, or an empty list if none are pending.

Remarks

Returns a copy of the current pending messages that have not yet been consumed by the injection loop. This can be used to display pending messages to the user. The returned list is a point-in-time snapshot; messages may be consumed between calls.

Applies to