Share via


IAgentThread.GetMessagesAsync Method

Definition

Retrieve thread messages in descending order (most recent first).

public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.Experimental.Agents.IChatMessage>> GetMessagesAsync (int? count = default, string? lastMessageId = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetMessagesAsync : Nullable<int> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.Experimental.Agents.IChatMessage>>
Public Function GetMessagesAsync (Optional count As Nullable(Of Integer) = Nothing, Optional lastMessageId As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IReadOnlyList(Of IChatMessage))

Parameters

count
Nullable<Int32>

The maximum number of messages requested

lastMessageId
String

The identifier of the last message retrieved

cancellationToken
CancellationToken

A cancellation token

Returns

An list of IChatMessage.

Applies to