fromTemplateFile static method
Future<HumanChatMessagePromptTemplate>
fromTemplateFile(
- String templateFile, {
- PartialValues? partialVariables,
- bool validateTemplate = true,
Load a prompt from a file. It considers the prompt a HumanChatMessage.
templateFile
the path to the file containing the prompt template.partialVariables
the partial variables to use for the template.validateTemplate
whether to validate the template.
Implementation
static Future<HumanChatMessagePromptTemplate> fromTemplateFile(
final String templateFile, {
final PartialValues? partialVariables,
final bool validateTemplate = true,
}) async {
final file = XFile(templateFile);
final template = await file.readAsString();
return HumanChatMessagePromptTemplate.fromTemplate(
template,
partialVariables: partialVariables,
validateTemplate: validateTemplate,
);
}