Share via


SelectionStrategy.NextAsync Method

Definition

Determine which agent goes next.

public System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.Agent> NextAsync (System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.Agents.Agent> agents, System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> history, System.Threading.CancellationToken cancellationToken = default);
member this.NextAsync : System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.Agents.Agent> * System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.Agent>
Public Function NextAsync (agents As IReadOnlyList(Of Agent), history As IReadOnlyList(Of ChatMessageContent), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Agent)

Parameters

agents
IReadOnlyList<Agent>

The agents participating in chat.

history
IReadOnlyList<ChatMessageContent>

The chat history.

cancellationToken
CancellationToken

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

Returns

The agent who shall take the next turn.

Applies to