Class HandlebarsPromptTemplate
- java.lang.Object
-
- com.microsoft.semantickernel.templateengine.handlebars.HandlebarsPromptTemplate
-
- All Implemented Interfaces:
PromptTemplate
public class HandlebarsPromptTemplate extends Object implements PromptTemplate
A prompt template that uses the Handlebars template engine to render prompts.
-
-
Constructor Summary
Constructors Constructor Description HandlebarsPromptTemplate(PromptTemplateConfig promptTemplate)Initializes a new instance of theHandlebarsPromptTemplateclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<String>renderAsync(Kernel kernel, KernelFunctionArguments arguments, InvocationContext context)Renders the template using the suppliedKernel,KernelFunctionArguments, andInvocationContext.
-
-
-
Constructor Detail
-
HandlebarsPromptTemplate
public HandlebarsPromptTemplate(@Nonnull PromptTemplateConfig promptTemplate)
Initializes a new instance of theHandlebarsPromptTemplateclass.- Parameters:
promptTemplate- The prompt template configuration.
-
-
Method Detail
-
renderAsync
public reactor.core.publisher.Mono<String> renderAsync(Kernel kernel, @Nullable KernelFunctionArguments arguments, @Nullable InvocationContext context)
Description copied from interface:PromptTemplateRenders the template using the suppliedKernel,KernelFunctionArguments, andInvocationContext.- Specified by:
renderAsyncin interfacePromptTemplate- Parameters:
kernel- TheKernelcontaining services, plugins, and other state for use throughout the operation.arguments- The arguments to use to satisfy any input variables in the prompt template.context- TheInvocationContextwhich carries optional information for the prompt rendering.- Returns:
- The rendered prompt.
-
-