RoundRobinGroupChatManager.ShouldTerminateAsync 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.
Determines whether the group chat should be terminated based on the provided chat history and iteration count.
protected internal override System.Threading.Tasks.ValueTask<bool> ShouldTerminateAsync(System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> history, System.Threading.CancellationToken cancellationToken = default);
override this.ShouldTerminateAsync : System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<bool>
Protected Friend Overrides Function ShouldTerminateAsync (history As IReadOnlyList(Of ChatMessage), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Boolean)
Parameters
- history
- IReadOnlyList<ChatMessage>
The chat history to consider.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
A Boolean indicating whether the chat should be terminated.