Share via


KernelFunctionSelectionStrategy Class

Definition

Determines agent selection based on the evaluation of a KernelFunction.

public class KernelFunctionSelectionStrategy : Microsoft.SemanticKernel.Agents.Chat.SelectionStrategy
type KernelFunctionSelectionStrategy = class
    inherit SelectionStrategy
Public Class KernelFunctionSelectionStrategy
Inherits SelectionStrategy
Inheritance
KernelFunctionSelectionStrategy

Constructors

KernelFunctionSelectionStrategy(KernelFunction, Kernel)

Determines agent selection based on the evaluation of a KernelFunction.

Fields

DefaultAgentsVariableName

The default value for AgentsVariableName.

DefaultHistoryVariableName

The default value for HistoryVariableName.

Properties

AgentsVariableName

Gets the KernelArguments key associated with the list of agent names when invoking Function.

Arguments

Gets the optional arguments used when invoking Function.

EvaluateNameOnly

Gets a value that indicates whether only the agent name is included in the history when invoking Function.

Function

Gets the KernelFunction invoked as selection criteria.

HasSelected

Gets a value that indicates if an agent has been selected (first time).

(Inherited from SelectionStrategy)
HistoryReducer

Gets an optional IChatHistoryReducer to reduce the history.

HistoryVariableName

Gets the KernelArguments key associated with the chat history when invoking Function.

InitialAgent

Gets or sets an optional agent for initial selection.

(Inherited from SelectionStrategy)
Kernel

Gets the Kernel used when invoking Function.

Logger

Gets the ILogger associated with the SelectionStrategy.

(Inherited from SelectionStrategy)
ResultParser

Gets a callback responsible for translating the FunctionResult to the termination criteria.

UseInitialAgentAsFallback

Gets a value that indicates whether InitialAgent is used in the event of a failure to select an agent.

Methods

NextAsync(IReadOnlyList<Agent>, IReadOnlyList<ChatMessageContent>, CancellationToken)

Determines which agent goes next.

(Inherited from SelectionStrategy)
SelectAgentAsync(IReadOnlyList<Agent>, IReadOnlyList<ChatMessageContent>, CancellationToken)

Determines which agent goes next.

Applies to