Class AggregatorPromptTemplateFactory
- java.lang.Object
-
- com.microsoft.semantickernel.semanticfunctions.AggregatorPromptTemplateFactory
-
- All Implemented Interfaces:
PromptTemplateFactory
public class AggregatorPromptTemplateFactory extends Object implements PromptTemplateFactory
An collection ofPromptTemplateFactoryinstances. The factory will try to create aPromptTemplateusing each factory in the collection until one is successful.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microsoft.semantickernel.semanticfunctions.PromptTemplateFactory
PromptTemplateFactory.UnknownTemplateFormatException
-
-
Constructor Summary
Constructors Constructor Description AggregatorPromptTemplateFactory(List<PromptTemplateFactory> templateFactories)Creates a new instance ofAggregatorPromptTemplateFactory.
-
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.
-
-
-
Constructor Detail
-
AggregatorPromptTemplateFactory
public AggregatorPromptTemplateFactory(List<PromptTemplateFactory> templateFactories)
Creates a new instance ofAggregatorPromptTemplateFactory.- Parameters:
templateFactories- the factories to aggregate
-
-
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()
-
-