Share via


ChatHistoryAgentThread.GetMessagesAsync(CancellationToken) Method

Definition

Asynchronously retrieves all messages in the thread.

public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> GetMessagesAsync(System.Threading.CancellationToken cancellationToken = default);
member this.GetMessagesAsync : System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent>
Public Function GetMessagesAsync (Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ChatMessageContent)

Parameters

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

The messages in the thread.

Exceptions

The thread has been deleted.

Remarks

Messages will be returned in ascending chronological order.

Applies to