AgentThread.OnNewMessageInternalAsync 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.
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.