"chat_template": "{%- macro flint_text(t) -%}\n{%- if t is string -%}\n{{- t | replace(\"\\x00\", \"\") | replace(\"<think>\", \"\") | replace(\"</think>\", \"\") | replace(\"<|begin_of_text|>\", \"<|begin_of_text|>\") | replace(\"<|end_of_text|>\", \"<|end_of_text|>\") | replace(\"<|system|>\", \"<|system|>\") | replace(\"<|developer|>\", \"<|developer|>\") | replace(\"<|user|>\", \"<|user|>\") | replace(\"<|assistant|>\", \"<|assistant|>\") | replace(\"<|observation|>\", \"<|observation|>\") -}}\n{%- else -%}\n{{- t -}}\n{%- endif -%}\n{%- endmacro -%}\n{%- set tool_preamble -%}\n{%- if tools %}<|system|>\n# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>\n{%- for tool in tools %}\n{%- set fn = tool.function if tool.function is defined else tool %}\n{%- if fn.description is defined and fn.description is not none %}\n{%- set spec = {\"name\": fn.name, \"description\": fn.description, \"parameters\": fn.parameters} %}\n{%- else %}\n{%- set spec = {\"name\": fn.name, \"parameters\": fn.parameters} %}\n{%- endif %}\n{{ spec | tojson(ensure_ascii=False) }}\n{%- endfor %}\n</tools>\n\nFor each function call, output the function name and arguments within the following XML format:\n<tool_call>{function-name}<arg_key>{arg-key-1}</arg_key><arg_value>{arg-value-1}</arg_value>...</tool_call>\n{% endif -%}\n{%- endset -%}\n{%- set ns = namespace(tools_pending=true) -%}\n{%- for m in messages -%}\n{%- set role = \"system\" if m.role == \"developer\" else m.role -%}\n{%- if ns.tools_pending and role != \"system\" -%}\n{{ tool_preamble }}\n{%- set ns.tools_pending = false -%}\n{%- endif -%}\n{%- if role == \"system\" -%}\n<|system|>{{ flint_text(m.content) }}\n{%- elif role == \"user\" -%}\n<|user|>{{ flint_text(m.content) }}\n{%- elif role == \"assistant\" -%}\n<|assistant|>\n{%- if m.reasoning_content %}<think>{{ m.reasoning_content }}</think>{% endif -%}\n{%- if m.content %}{{ m.content }}{% endif -%}\n{%- if m.tool_calls -%}\n{%- for tc in m.tool_calls -%}\n{%- set fn = tc.function if tc.function is defined else tc -%}\n<tool_call>{{ fn.name }}\n{%- for k, v in fn.arguments.items() -%}\n<arg_key>{{ k }}</arg_key><arg_value>{{ v | tojson(ensure_ascii=False) if v is not string else v }}</arg_value>\n{%- endfor -%}\n</tool_call>\n{%- endfor -%}\n{%- endif -%}\n{%- elif role == \"tool\" -%}\n<|observation|><tool_response>{{ flint_text(m.content) }}</tool_response>\n{%- endif -%}\n{%- endfor -%}\n{%- if ns.tools_pending -%}\n{{ tool_preamble }}\n{%- endif -%}\n{%- if add_generation_prompt -%}\n<|assistant|>\n{%- endif -%}\n",