HandlebarsPromptTemplateOptions.RegisterCustomHelpers Property
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.
Callback for registering custom helpers.
public Action<Microsoft.SemanticKernel.PromptTemplates.Handlebars.HandlebarsPromptTemplateOptions.RegisterHelperCallback,Microsoft.SemanticKernel.PromptTemplates.Handlebars.HandlebarsPromptTemplateOptions,Microsoft.SemanticKernel.KernelArguments>? RegisterCustomHelpers { get; set; }
member this.RegisterCustomHelpers : Action<Microsoft.SemanticKernel.PromptTemplates.Handlebars.HandlebarsPromptTemplateOptions.RegisterHelperCallback, Microsoft.SemanticKernel.PromptTemplates.Handlebars.HandlebarsPromptTemplateOptions, Microsoft.SemanticKernel.KernelArguments> with get, set
Public Property RegisterCustomHelpers As Action(Of HandlebarsPromptTemplateOptions.RegisterHelperCallback, HandlebarsPromptTemplateOptions, KernelArguments)
Property Value
The callback takes three parameters:
- A callback representing the
RegisterHelperSafemethod to register new helpers with built-in conflict handling. - A HandlebarsPromptTemplateOptions representing the configuration for helpers.
- A KernelArguments instance containing variables maintained by the Handlebars context.
Examples
HandlebarsPromptTemplateOptions.RegisterCustomHelpers = (RegisterHelperCallback registerHelper, HandlebarsPromptTemplateOptions options, KernelArguments variables) =>
{
registerHelper("customHelper", (Context context, Arguments arguments) =>
{
// Custom helper logic
});
};
Remarks
This callback allows users to register their custom helpers while ensuring that they don't conflict with existing system or custom helpers. Users should use the provided `registerHelper` callback when registering their custom helpers.