{ "chat_template": "{%- if not date_string is defined %}\n {%- set date_string = \"26 July 2024\" %}\n{%- endif %}\n\n{#- This block extracts the system message, so we can slot it into the right place. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content'] %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = \"\" %}\n{%- endif %}\n\n{#- System message + builtin tools #}\n{{- \"<|start_header_id|>system<|end_header_id|>\n\n\" }}\n{{- \"Cutting Knowledge Date: December 2023\n\" }}\n{{- \"Today Date: \" + date_string + \"\n\n\" }}\n{{- system_message }}\n{{- \"<|eot_id|>\" }}\n\n\n{%- set first_user_message = True %}\n{%- for message in messages %}\n {%- if first_user_message and message['role'] == 'user' %}\n\t\t{%- set first_user_message = False %}\n\t {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n<|reserved_special_token_70|><|reserved_special_token_69|><|reserved_special_token_71|>'+ message['content'].replace('<|reserved_special_token_69|>', '').lstrip() + '<|eot_id|>' }}\n\t{%- else %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] + '<|eot_id|>' }}\n\t{%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\n\n' }}\n{%- endif %}\n" }