AgentChat.GetChatMessagesAsync Method

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.

Overloads

GetChatMessagesAsync(CancellationToken)

Retrieve the chat history.

GetChatMessagesAsync(Agent, CancellationToken)

Retrieve the message history, either the primary history or an agent specific version.

GetChatMessagesAsync(CancellationToken)

Retrieve the chat history.

C#
public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> GetChatMessagesAsync (System.Threading.CancellationToken cancellationToken = default);

Parameters

cancellationToken
CancellationToken

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

Returns

The message history

Applies to

Semantic Kernel Dotnet Latest
Proizvod Verzije
Semantic Kernel Dotnet Latest

GetChatMessagesAsync(Agent, CancellationToken)

Retrieve the message history, either the primary history or an agent specific version.

C#
public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> GetChatMessagesAsync (Microsoft.SemanticKernel.Agents.Agent? agent, System.Threading.CancellationToken cancellationToken = default);

Parameters

agent
Agent

An optional agent, if requesting an agent history.

cancellationToken
CancellationToken

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

Returns

The message history

Remarks

Any AgentChat instance does not support concurrent invocation and will throw exception if concurrent activity is attempted.

Applies to

Semantic Kernel Dotnet Latest
Proizvod Verzije
Semantic Kernel Dotnet Latest