ChatMessagePromptTemplate.ai constructor

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

Creates a AIChatMessagePromptTemplate from a string template.

This is a convenience factory equivalent to AIChatMessagePromptTemplate.fromTemplate.

Example:

final msgTemplate = ChatMessagePromptTemplate.ai("I'm an AI. I'm {foo}. I'm {bar}.");
  • template the template string.
  • partialVariables the partial variables to use for the template.
  • validateTemplate whether to validate the template.

Implementation

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