Proposal: new chat_template_arg `enable_history_reasoning` for reusing prompt cache among querys within Agents .

#39
Files changed (1) hide show
  1. chat_template.jinja +1 -1
chat_template.jinja CHANGED
@@ -97,7 +97,7 @@
97
  {%- endif %}
98
  {%- endif %}
99
  {%- set reasoning_content = reasoning_content|trim %}
100
- {%- if loop.index0 > ns.last_query_index %}
101
  {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
  {%- else %}
103
  {{- '<|im_start|>' + message.role + '\n' + content }}
 
97
  {%- endif %}
98
  {%- endif %}
99
  {%- set reasoning_content = reasoning_content|trim %}
100
+ {%- if loop.index0 > ns.last_query_index or enable_history_reasoning is defined and enable_history_reasoning is true %}
101
  {{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
102
  {%- else %}
103
  {{- '<|im_start|>' + message.role + '\n' + content }}