{%- for message in messages %}
{%- if message['role'] == 'system' -%}
<|im_start|>system
{{ message['content'] }}<|im_end|>
{%- elif message['role'] == 'user' -%}
<|im_start|>user
{{ message['content'] }}<|im_end|>
{%- elif message['role'] == 'assistant' -%}
<|im_start|>assistant
{{ message['content'] }}<|im_end|>
{%- elif message['role'] == 'tool' -%}
<|im_start|>tool
{{ message['content'] }}<|im_end|>
{%- endif -%}
{%- endfor %}
<|im_start|>assistant
