Share via


AgentGroupChat.CreatePromptFunctionForStrategy Method

Definition

Creates a KernelFunction for a given strategy without HTML-encoding the specified parameters.

public static Microsoft.SemanticKernel.KernelFunction CreatePromptFunctionForStrategy(string template, Microsoft.SemanticKernel.IPromptTemplateFactory? templateFactory = default, params string[] safeParameterNames);
static member CreatePromptFunctionForStrategy : string * Microsoft.SemanticKernel.IPromptTemplateFactory * string[] -> Microsoft.SemanticKernel.KernelFunction
Public Shared Function CreatePromptFunctionForStrategy (template As String, Optional templateFactory As IPromptTemplateFactory = Nothing, ParamArray safeParameterNames As String()) As KernelFunction

Parameters

template
String

The prompt template string that defines the prompt.

templateFactory
IPromptTemplateFactory

An optional IPromptTemplateFactory to use when interpreting the template. The default factory is used when none is provided.

safeParameterNames
String[]

The parameter names to exclude from being HTML encoded.

Returns

A KernelFunction created via KernelFunctionFactory using the specified template.

Remarks

This method is particularly targeted to easily avoid encoding the history used by KernelFunctionSelectionStrategy or KernelFunctionTerminationStrategy.

Applies to