}
}
} else {
- jmsg["content"] = json(); // null
+ jmsg["content"] = "";
}
if (!msg.reasoning_content.empty()) {
jmsg["reasoning_content"] = msg.reasoning_content;
{%- if message['role'] == 'user' -%}
{{- '<|User|>' + message['content'] + '<|end▁of▁sentence|>' -}}
{%- endif -%}
- {%- if message['role'] == 'assistant' and message['content'] is none -%}
+ {%- if message['role'] == 'assistant' and not message['content'] -%}
{{- '<|Assistant|><|tool▁calls▁begin|>' -}}
{%- set ns.is_first = true -%}
{%- for tc in message['tool_calls'] -%}
{%- endfor -%}
{{- '<|tool▁calls▁end|><|end▁of▁sentence|>' -}}
{%- endif -%}
- {%- if message['role'] == 'assistant' and message['content'] is not none -%}
+ {%- if message['role'] == 'assistant' and message['content'] -%}
{{- flush_tool_outputs() -}}
{%- set content = message['content'] -%}
{%- if '</think>' in content -%}
{{- flush_tool_outputs() -}}
{%- if add_generation_prompt and not ns.is_tool_outputs -%}
{{- '<|Assistant|><think>\n' -}}
-{%- endif -%}
\ No newline at end of file
+{%- endif -%}
"[\n"
" {\n"
" \"role\": \"assistant\",\n"
- " \"content\": null,\n"
+ " \"content\": \"\",\n"
" \"tool_calls\": [\n"
" {\n"
" \"type\": \"function\",\n"
" },\n"
" \"id\": \"123456789\"\n"
" }\n"
- " ]\n"
+ " ],\n"
+ " \"content\": \"\"\n"
"}");
}
{
" },\n"
" \"id\": \"123456789\"\n"
" }\n"
- " ]\n"
+ " ],\n"
+ " \"content\": \"\"\n"
"}",
/* expect_grammar_triggered= */ false
);