from langchain_core.prompts import PromptTemplate
prompt = PromptTemplate(
template="Hello {{name}}", # Mustache syntax
template_format="mustache",
input_variables=["name"]
)
Error:
ValueError: Mustache templates cannot be validated.

from langchain_core.prompts import PromptTemplate
prompt = PromptTemplate(
template="Hello {{name}}", # Mustache syntax
template_format="mustache",
input_variables=["name"]
)
Error:
ValueError: Mustache templates cannot be validated.
Fix: Use f-string or jinja2 instead:
prompt = PromptTemplate(
template="Hello {name}", # f-string
template_format="f-string",
input_variables=["name"]
)
Tell us about your project and get help tailored to your problem.
Contact usEveryone can read. Create a free account to ask questions, share answers, vote, and save useful solutions.