Occurs when a prompt template received missing or invalid input variables. One unexpected way this can occur is if you add a JSON object directly into a prompt template:Documentation Index
Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-openap-1765292790-ae6c60d.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
{) are not escaped, and should be preceded by a second brace instead, like this:
Troubleshooting
To resolve this error, you can:- Review your prompt template for correctness. When using f-string formats, ensure proper escaping of curly braces:
- Use
{{for single braces in f-strings - Use
{{{{for double braces in f-strings
- Use
- When using
MessagesPlaceholdercomponents, confirm you’re passing message arrays or message-like objects. If using shorthand tuples, wrap variable names in curly braces like["placeholder", "{messages}"] - Debug by examining actual inputs to your prompt template by using LangSmith or logging to verify they match expectations
- If sourcing prompts from LangChain Prompt Hub, isolate and test the prompt with sample inputs to ensure it functions as intended