Share via


AgentThread.OnNewMessageInternalAsync Method

Definition

This method is called when a new message has been contributed to the chat by any participant. Checks have already been completed in the Microsoft.SemanticKernel.Agents.AgentThread.OnNewMessageAsync(Microsoft.SemanticKernel.ChatMessageContent,System.Threading.CancellationToken) method to ensure that the thread can be updated.

protected abstract System.Threading.Tasks.Task OnNewMessageInternalAsync(Microsoft.SemanticKernel.ChatMessageContent newMessage, System.Threading.CancellationToken cancellationToken = default);
abstract member OnNewMessageInternalAsync : Microsoft.SemanticKernel.ChatMessageContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Protected MustOverride Function OnNewMessageInternalAsync (newMessage As ChatMessageContent, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

newMessage
ChatMessageContent

The new message.

cancellationToken
CancellationToken

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

Returns

A task that completes when the context has been updated.

Applies to