Class HandlebarsPromptTemplateFactory
- java.lang.Object
-
- com.microsoft.semantickernel.semanticfunctions.HandlebarsPromptTemplateFactory
-
- All Implemented Interfaces:
PromptTemplateFactory
public class HandlebarsPromptTemplateFactory extends Object implements PromptTemplateFactory
A factory for creating aHandlebarsPromptTemplateinstance for aPromptTemplateConfigthat uses the handlebars template format.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microsoft.semantickernel.semanticfunctions.PromptTemplateFactory
PromptTemplateFactory.UnknownTemplateFormatException
-
-
Field Summary
Fields Modifier and Type Field Description static StringHANDLEBARS_TEMPLATE_FORMATThe handlebars template format.
-
Constructor Summary
Constructors Constructor Description HandlebarsPromptTemplateFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PromptTemplatetryCreate(PromptTemplateConfig templateConfig)Create a prompt template, if possible, from the given configuration.
-
-
-
Field Detail
-
HANDLEBARS_TEMPLATE_FORMAT
public static final String HANDLEBARS_TEMPLATE_FORMAT
The handlebars template format.- See Also:
- Constant Field Values
-
-
Method Detail
-
tryCreate
public PromptTemplate tryCreate(@NonNull PromptTemplateConfig templateConfig)
Description copied from interface:PromptTemplateFactoryCreate a prompt template, if possible, from the given configuration. If thePromptTemplateConfigis not supported, the method should throw anUnknownTemplateFormatException.- Specified by:
tryCreatein interfacePromptTemplateFactory- Parameters:
templateConfig- The configuration for the prompt template.- Returns:
- The prompt template.
- See Also:
PromptTemplateConfig.getTemplateFormat()
-
-