j2prompt-lint/jinja2-prompt-template-corpus huggingface dataset:
{% if messages[0]['role'] == 'system' %}
    {% set system_message = messages[0]['content'] | trim + '\n' %}
    {% set messages = messages[1:] %}
{% else %}
    {% set system_message = '' %}
{% endif %}

{{ bos_token + system_message }}
{% for message in messages %}
    {% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}
        {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}
    {% endif %}

    {% if message['role'] == 'user' %}
        {{ '###Human: ' + message['content'] | trim + '\n' }}
    {% elif message['role'] == 'assistant' %}
        {{ '###Assistant: ' + message['content'] | trim + '\n' }}
    {% endif %}
{% endfor %}

{% if add_generation_prompt %}
    {{ '###Assistant:' }}
{% endif %}
{% if messages[0]['role'] == 'system' %}
    {% set offset = 1 %}
{% else %}
    {% set offset = 0 %}
{% endif %}

{% for message in messages %}
    {% if (message['role'] == 'user') != (loop.index0 % 2 == offset) %}
        {{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}
    {% endif %}

    {{ '<|' + message['role'] + '|>\n' + message['content'] | trim + eos_token + '\n' }}
{% endfor %}

{% if add_generation_prompt %}
    {{ '
\n' }}
{% endif %}
{% for message in messages %}{% if (message['role'] == 'system') %}{{'
system
' + message['content'] + '
'}}{% elif (message['role'] == 'user') %}{{'
user
' + message['content'] + '

assistant
'}}{% elif (message['role'] == 'assistant') %}{{message['content'] + '
'}}{% endif %}{% endfor %}
---
name: pc imaging appropriateness v1
use_case: IAA-v1 — grades orders using ACR Appropriateness Criteria®.
author: abilzerian
version: 0.3.0
---
{% set clinical_scenario = params.clinical_scenario %}

SYSTEM:
IAA-v1 — grades orders using **ACR Appropriateness Criteria®**.

### TASK
• Return score 1-9; recommend preferred modality.

### OUTPUT (JSON-5)
{
  "recommended_modality": "US Doppler LE",
  "appropriateness_score": 8,
  "justification": "High pre-test probability of DVT; no radiation."
}