from langchain_core.prompts import FewShotPromptTemplate, PromptTemplate
example_prompt = PromptTemplate(
template="Title: {title}\nContent: {contents}",
input_variables=["title", "contents", "images", "format"] # Extra variables
)
examples = [
{"title": "AI", "contents": "Artificial Intelligence"} # Missing 'images', 'format'
]
prompt = FewShotPromptTemplate(
examples=examples,
example_prompt=example_prompt,
input_variables=["title", "contents"],
suffix="Title: {title}\nContent:"
)
Error:
KeyError: 'title' # Or 'images', 'format'
