Skip to content

Commit ef1ab23

Browse files
zhyncsgithub-actions[bot]LorrinWWW
authored
[Auto Sync] Update tool_chat_template_deepseekv31.jinja (20251210) (#14837)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Jue Wang <zjuwangjue@gmail.com>
1 parent d659873 commit ef1ab23

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/chat_template/tool_chat_template_deepseekv31.jinja

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
{% if tools is defined and tools is not none %}
2020
{% set tool_ns = namespace(text='## Tools\nYou have access to the following tools:\n') %}
2121
{% for tool in tools %}
22-
{% set tool_ns.text = tool_ns.text + '\n### ' + tool.function.name + '\nDescription: ' + tool.function.description + '\n\nParameters: ' + (tool.function.parameters | tojson) + '\n' %}
22+
{% if tool.function.description is not none %}
23+
{% set tool_ns.text = tool_ns.text + '\n### ' + tool.function.name + '\nDescription: ' + tool.function.description + '\n\nParameters: ' + (tool.function.parameters | tojson) + '\n' %}
24+
{% else %}
25+
{% set tool_ns.text = tool_ns.text + '\n### ' + tool.function.name + '\n\nParameters: ' + (tool.function.parameters | tojson) + '\n' %}
26+
{% endif %}
2327
{% endfor %}
2428
{% set tool_ns.text = tool_ns.text + "\nIMPORTANT: ALWAYS adhere to this exact format for tool use:\n<|tool▁calls▁begin|><|tool▁call▁begin|>tool_call_name<|tool▁sep|>tool_call_arguments<|tool▁call▁end|>{{additional_tool_calls}}<|tool▁calls▁end|>\n\nWhere:\n\n- `tool_call_name` must be an exact match to one of the available tools\n- `tool_call_arguments` must be valid JSON that strictly follows the tool's Parameters Schema\n- For multiple tool calls, chain them directly without separators or spaces\n" %}
2529
{% set ns.system_prompt = ns.system_prompt + '\n\n' + tool_ns.text %}

0 commit comments

Comments
 (0)