litmudoc commited on
Commit
76fbe26
·
verified ·
1 Parent(s): 2a36459

Upload chat_template.jinja

Browse files
Files changed (1) hide show
  1. chat_template.jinja +4 -4
chat_template.jinja CHANGED
@@ -17,7 +17,7 @@
17
  {{- "\nHere are the tools available to you in JSON format within <tool> and </tool> tags:\n" }}
18
  {%- for tool in tools %}
19
  {{- "<tool>" }}
20
- {{- tool | tojson(ensure_ascii=False) | safe }}
21
  {{- "</tool>\n" }}
22
  {%- endfor %}
23
 
@@ -63,7 +63,7 @@
63
 
64
  {%- if msg.content %}
65
  {%- if "</think>" in msg.content %}
66
- {%- set content = msg.content.split('</think>')[-1].strip() %}
67
  {%- set reasoning_content = msg.content.split('</think>')[0].strip() %}
68
  {%- if reasoning_content.startswith("<think>") %}
69
  {%- set reasoning_content = reasoning_content[9:].strip() %}
@@ -105,7 +105,7 @@
105
  {{- raise_exception('arguments or parameters are mandatory: ' ~ tool_call) }}
106
  {%- endif %}
107
 
108
- {{- "<tool_call>" }}{"name": "{{- tool_call.name }}", "arguments": {{ arguments | tojson(ensure_ascii=False) | safe }}}{{- "</tool_call>" }}
109
 
110
  {%- if not loop.last %}
111
  {{- "\n" }}
@@ -120,7 +120,7 @@
120
  {{- role_indicators['tool'] }}
121
  {%- endif %}
122
  {%- if msg.content is defined %}
123
- {{- "<tool_result>" }}{"result": {{ msg.content | tojson(ensure_ascii=False) | safe }}}{{- "</tool_result>" }}
124
  {%- endif %}
125
  {%- if loop.last or messages[i + 1].role != "tool" %}
126
  {{- end_of_turn -}}
 
17
  {{- "\nHere are the tools available to you in JSON format within <tool> and </tool> tags:\n" }}
18
  {%- for tool in tools %}
19
  {{- "<tool>" }}
20
+ {{- tool | tojson(ensure_ascii=False) }}
21
  {{- "</tool>\n" }}
22
  {%- endfor %}
23
 
 
63
 
64
  {%- if msg.content %}
65
  {%- if "</think>" in msg.content %}
66
+ {%- set content = msg.content.split('</think>')[-1].lstrip() %}
67
  {%- set reasoning_content = msg.content.split('</think>')[0].strip() %}
68
  {%- if reasoning_content.startswith("<think>") %}
69
  {%- set reasoning_content = reasoning_content[9:].strip() %}
 
105
  {{- raise_exception('arguments or parameters are mandatory: ' ~ tool_call) }}
106
  {%- endif %}
107
 
108
+ {{- "<tool_call>" }}{"name": "{{- tool_call.name }}", "arguments": {{ arguments | tojson(ensure_ascii=False) }}}{{- "</tool_call>" }}
109
 
110
  {%- if not loop.last %}
111
  {{- "\n" }}
 
120
  {{- role_indicators['tool'] }}
121
  {%- endif %}
122
  {%- if msg.content is defined %}
123
+ {{- "<tool_result>" }}{"result": {{ msg.content | tojson(ensure_ascii=False) }}}{{- "</tool_result>" }}
124
  {%- endif %}
125
  {%- if loop.last or messages[i + 1].role != "tool" %}
126
  {{- end_of_turn -}}