|
@@ -38,7 +38,7 @@ Example function tool call syntax:
|
|
|
{%- if message['role'] == 'user' -%}
|
|
{%- if message['role'] == 'user' -%}
|
|
|
{{- '<|User|>' + message['content'] + '<|end▁of▁sentence|>' -}}
|
|
{{- '<|User|>' + message['content'] + '<|end▁of▁sentence|>' -}}
|
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
|
- {%- if message['role'] == 'assistant' and message['content'] is none -%}
|
|
|
|
|
|
|
+ {%- if message['role'] == 'assistant' and not message['content'] -%}
|
|
|
{{- '<|Assistant|><|tool▁calls▁begin|>' -}}
|
|
{{- '<|Assistant|><|tool▁calls▁begin|>' -}}
|
|
|
{%- set ns.is_first = true -%}
|
|
{%- set ns.is_first = true -%}
|
|
|
{%- for tc in message['tool_calls'] -%}
|
|
{%- for tc in message['tool_calls'] -%}
|
|
@@ -53,7 +53,7 @@ Example function tool call syntax:
|
|
|
{%- endfor -%}
|
|
{%- endfor -%}
|
|
|
{{- '<|tool▁calls▁end|><|end▁of▁sentence|>' -}}
|
|
{{- '<|tool▁calls▁end|><|end▁of▁sentence|>' -}}
|
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
|
- {%- if message['role'] == 'assistant' and message['content'] is not none -%}
|
|
|
|
|
|
|
+ {%- if message['role'] == 'assistant' and message['content'] -%}
|
|
|
{{- flush_tool_outputs() -}}
|
|
{{- flush_tool_outputs() -}}
|
|
|
{%- set content = message['content'] -%}
|
|
{%- set content = message['content'] -%}
|
|
|
{%- if '</think>' in content -%}
|
|
{%- if '</think>' in content -%}
|
|
@@ -73,4 +73,4 @@ Example function tool call syntax:
|
|
|
{{- flush_tool_outputs() -}}
|
|
{{- flush_tool_outputs() -}}
|
|
|
{%- if add_generation_prompt and not ns.is_tool_outputs -%}
|
|
{%- if add_generation_prompt and not ns.is_tool_outputs -%}
|
|
|
{{- '<|Assistant|><think>\n' -}}
|
|
{{- '<|Assistant|><think>\n' -}}
|
|
|
-{%- endif -%}
|
|
|
|
|
|
|
+{%- endif -%}
|