haystack
haystack copied to clipboard
Jinja2 Template Pitfall usinf f-Strings
Describe the bug Hey, when using i. e. the PromptBuilder and f-Strings, take care of using quad-braces. Here is how it does not work:
template = f"""
The language tag is:
{language}
Request: {{ question }}
"""
prompt_builder = PromptBuilder(template=template)
Whereby it results for me in
raise ValueError(f"Input {input_name} not found in component {component_name}.")
However using
template = f"""
The language tag is:
{language}
Request: {{{{ question }}}}
"""
prompt_builder = PromptBuilder(template=template)
works. Maybe it could be mentioned somewhere? documentation? Struggeld a bit on this.