{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'assistant') %}{% set role = 'A:' %}{% elif (message['role'] == 'user') %}{% set role = 'Q: ' %}{% else %}{% set role = message['role'] %}{% endif %}{{ role + ' ' + message['content'] | trim + ' ' }}{% endfor %}{% if add_generation_prompt %}{{'A: '}}{% endif %}