{{- bos_token }} {%- for message in messages %} {%- if message['role'] == 'system' %} {#- Ignore system messages entirely in this template. #} {%- elif message['role'] == 'user' %} {{- '<|start_header_id|>user<|end_header_id|>\n\n' }} {{- message['content'] | trim }} {{- eos_token }} {%- elif message['role'] == 'assistant' %} {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }} {%- generation -%} {{- message['content'] | trim }} {{- eos_token }} {%- endgeneration -%} {%- else %} {{- raise_exception("Unsupported role for no-system/no-tools template: " + message['role']) }} {%- endif %} {%- endfor %} {%- if add_generation_prompt %} {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }} {%- endif %}