{% if safety_instructions %}
- name: "safety_instructions"
  content: |
    {{ settings.start_token }}{{ escape_special_characters(safety_instructions) }}{{ settings.eom }}
    {%- set settings.start_token = settings.bom -%}
{% endif %}

{% for cc_msg in pretruncate_messages(chat_context_messages, token_limit) %}
  {% if not should_remove_safety_truncated_messages or not cc_msg.is_safety_truncated %}
    {% set qual_author_msg =  canonicalize_user_name(cc_msg.author) + ": " + cc_msg.text %}
- name: "message_{{ loop.index }}"
  truncation_priority: 5
  content: |
    {{ settings.start_token }}{{ escape_special_characters(qual_author_msg) }}{{ settings.eom }}
    {%- set settings.start_token = settings.bom -%}
  {% endif %}
{% endfor %}
