PromptTemplateFactory Interface
public interface PromptTemplateFactory
The interface that a PromptTemplateFactory implementation must provide.
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Prompt |
build(PromptTemplateConfig templateConfig)
Create a prompt template, if possible, from the given configuration. |
|
abstract
Prompt |
tryCreate(PromptTemplateConfig templateConfig)
Create a prompt template, if possible, from the given configuration. |
Method Details
build
public static PromptTemplate build(PromptTemplateConfig templateConfig)
Create a prompt template, if possible, from the given configuration. This is a convenience method that wraps the tryCreate(PromptTemplateConfig templateConfig) method.
Parameters:
Returns:
tryCreate
public abstract PromptTemplate tryCreate(PromptTemplateConfig templateConfig)
Create a prompt template, if possible, from the given configuration. If the PromptTemplateConfig is not supported, the method should throw an UnknownTemplateFormatException.
Parameters:
Returns: