j2prompt-lint/jinja2-prompt-template-corpus huggingface dataset:
{% set ns = namespace(has_head=true) %}{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = message['content'] %}{% if loop.index0 == 0 %}{% if content == '' %}{% set ns.has_head = false %}{% elif message['role'] == 'system' %}{% set content = '
' + content + '
' %}{% endif %}{% endif %}{% if message['role'] == 'user' %}{% if loop.index0 == 1 and ns.has_head %}{% set content = content + '
' %}{% else %}{% set content = '
' + content + '
' %}{% endif %}{% elif message['role'] == 'assistant' %}{% set content = content + '
' %}{% endif %}{{ content }}{% endfor %}