InMemoryChatHistoryProvider.GetMessages(AgentSession) Method

Definition

Gets the chat messages stored for the specified session.

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

Parameters

session
AgentSession

The agent session containing the state.

Returns

A list of chat messages, or an empty list if no state is found.

Applies to