spicyneuron commited on
Commit
cea20af
·
verified ·
1 Parent(s): 887f95f

Update chat_template.jinja

Browse files
Files changed (1) hide show
  1. chat_template.jinja +3 -1
chat_template.jinja CHANGED
@@ -94,7 +94,7 @@ For each function call, output the function name and arguments within the follow
94
  {%- endif %}
95
  {%- if m.content is string -%}
96
  {{- '<tool_response>' + m.content + '</tool_response>' -}}
97
- {%- else -%}
98
  {{- '<tool_response><tools>\n' -}}
99
  {% for tr in m.content %}
100
  {%- for tool in tools -%}
@@ -107,6 +107,8 @@ For each function call, output the function name and arguments within the follow
107
  {%- endfor -%}
108
  {%- endfor -%}
109
  {{- '</tools></tool_response>' -}}
 
 
110
  {% endif -%}
111
  {%- elif m.role == 'system' -%}
112
  <|system|>{{ visible_text(m.content) }}
 
94
  {%- endif %}
95
  {%- if m.content is string -%}
96
  {{- '<tool_response>' + m.content + '</tool_response>' -}}
97
+ {%- elif m.content is iterable and m.content is not mapping and m.content and m.content.0.type == "tool_reference" -%}
98
  {{- '<tool_response><tools>\n' -}}
99
  {% for tr in m.content %}
100
  {%- for tool in tools -%}
 
107
  {%- endfor -%}
108
  {%- endfor -%}
109
  {{- '</tools></tool_response>' -}}
110
+ {%- else -%}
111
+ {{- '<tool_response>' + visible_text(m.content) + '</tool_response>' -}}
112
  {% endif -%}
113
  {%- elif m.role == 'system' -%}
114
  <|system|>{{ visible_text(m.content) }}