ChatMessagePromptTemplate.human constructor

ChatMessagePromptTemplate.human(
  1. String template, {
  2. PartialValues? partialVariables,
  3. bool validateTemplate = true,
})

Creates a HumanChatMessagePromptTemplate from a string template.

This is a convenience factory equivalent to HumanChatMessagePromptTemplate.fromTemplate.

Example:

final msgTemplate = ChatMessagePromptTemplate.human(
  "Hello {foo}, I'm {bar}. Thanks for the {context}",
);
  • template the template string.
  • partialVariables the partial variables to use for the template.
  • validateTemplate whether to validate the template.

Implementation

factory ChatMessagePromptTemplate.human(
  final String template, {
  final PartialValues? partialVariables,
  final bool validateTemplate = true,
}) {
  return HumanChatMessagePromptTemplate.fromTemplate(
    template,
    partialVariables: partialVariables,
    validateTemplate: validateTemplate,
  );
}