tool-call(dsv3): Fixed a parse problem when there are multiple function definitions in tool_calls (#10209)

This commit is contained in:
Yiming
2025-09-09 15:47:28 +08:00
committed by GitHub
parent f5f6b3b4b5
commit 2cd94dd07e

View File

@@ -55,7 +55,7 @@
{%- endif %}
{%- set ns.is_first = true -%}
{%- else %}
{{- '\n' + '<tool▁call▁begin>' + tool['type'] + '<tool▁sep>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments'] + '\n' + '```' + '<tool▁call▁end>'}}
{{- '\n' + '<tool▁call▁begin>' + tool['type'] + '<tool▁sep>' + tool['function']['name'] + '\n' + '```json' + '\n' + tool['function']['arguments']|tojson + '\n' + '```' + '<tool▁call▁end>'}}
{%- endif %}
{%- endfor %}
{{- '<tool▁calls▁end><end▁of▁sentence>'}}