MessagePromptTemplate
. You can build a ChatPromptTemplate
from one or more MessagePromptTemplates
. You can use ChatPromptTemplate
’s format_prompt
— this returns a PromptValue
, which you can convert to a string or Message object, depending on whether you want to use the formatted value as input to an llm or chat model.
For convenience, there is a from_template
method exposed on the template. If you were to use this template, this is what it would look like: