from langchain_core.prompts import ChatPromptTemplate prompt = ChatPromptTemplate.from_messages( [ ("system", "You write release notes for infrastructure teams."), ( "human", "Summarize {change} for {audience} in no more than {sentences} sentences.", ), ] ) values = { "change": "automated snapshot cleanup", "audience": "database operators", "sentences": 2, } prompt_value = prompt.invoke(values) print("Required variables:", ", ".join(prompt.input_variables)) for message in prompt_value.to_messages(): print(f"{message.type}: {message.content}")