from langchain_core.prompts import PromptTemplate
phrase = "Have a nice day!"
prompt_template = """
{phrase}
How can I help you? {phrase}
"""
prompt = PromptTemplate(
input_variables=["human_input"],
template=prompt_template,
partial_variables={"phrase": phrase} # Used twice
)
Error:
text
ValidationError: 2 validation errors for PromptTemplate
partial_variables
extra fields not permitted (type=value_error.extra)
__root__
Invalid prompt schema; check for mismatched or missing input parameters. 'phrase'
(type=value_error)