Partager via


SelectionStrategy.SelectAgentAsync Method

Definition

Determine which agent goes next.

protected abstract System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.Agent> SelectAgentAsync (System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.Agents.Agent> agents, System.Collections.Generic.IReadOnlyList<Microsoft.SemanticKernel.ChatMessageContent> history, System.Threading.CancellationToken cancellationToken = default);
abstract member SelectAgentAsync : 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>
Protected MustOverride Function SelectAgentAsync (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