ChatMessagePromptTemplate.system constructor

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

Creates a SystemChatMessagePromptTemplate from a string template.

This is a convenience factory equivalent to SystemChatMessagePromptTemplate.fromTemplate.

Example:

final msgTemplate = ChatMessagePromptTemplate.system("Here's some context: {context}");
  • template the template string.
  • partialVariables the partial variables to use for the template.
  • validateTemplate whether to validate the template.

Implementation

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