{% set character_definition_messages = get_character_priming(character, username) %}
{% if character_definition_messages %}
{% for message_dict in character_definition_messages %}
  {% set message = canonicalize_user_name(message_dict.get("src", "")) + ": " + message_dict.get("text", "") %}
- name: "character_definition_message_{{ loop.index }}"
  raw_string: |
    {{ settings.start_token }}{{ maybe_inject_narrator(escape_sequences(message)) }}{{ settings.eom }}
  {% set settings.start_token = settings.bom %}

  # Note: This is a special case where we are injecting the persona definition into the second character definition message.
  {% if loop.index == 1 and persona_definition %}
- name: "persona"
  raw_string: |
    {{ settings.start_token }}{{ narrator_name }}: {{ canonicalize_user_name(username) }}'s self-intro is {{ escape_sequences(persona_definition) }}{{ settings.eom }}
  {% endif %}
{% endfor %}
{% elif persona_definition %}
- name: "persona"
  raw_string: |
    {{ settings.start_token }}{{ narrator_name }}: {{ canonicalize_user_name(username) }}'s self-intro is {{ escape_sequences(persona_definition) }}{{ settings.eom }}
  {% set settings.start_token = settings.bom %}
{% endif %}
