You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
" {{- '# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>' -}}\n"
5551
+
" {%- for tool in tools -%}\n"
5552
+
" {{- '\\n' -}}\n"
5553
+
" {{- tool | tojson -}}\n"
5554
+
" {%- endfor -%}\n"
5555
+
" {{- '\\n</tools>\\n\\nAlways adhere to this exact format for tool use:\\n<tool_calls>\\n<tool_call>\\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\\n</tool_call>\\n{additional_tool_calls}</tool_calls>\\n\\nNote:\\n- For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags.\\n- `<function-name>` must be an exact match to one of the available tools.\\n- `<args-json-object>` must be valid JSON that strictly follows the tool\\'s parameters schema.<|im_end|>\\n' -}}\n"
"{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) -%}\n"
5563
+
"{%- for message in messages[::-1] -%}\n"
5564
+
" {%- set index = (messages|length - 1) - loop.index0 -%}\n"
5565
+
" {%- if ns.multi_step_tool and message.role == 'user' and render_content(message.content) is string and not(render_content(message.content).startswith('<tool_response>') and render_content(message.content).endswith('</tool_response>')) -%}\n"
5566
+
" {%- set ns.multi_step_tool = false -%}\n"
5567
+
" {%- set ns.last_query_index = index -%}\n"
5568
+
" {%- endif -%}\n"
5569
+
"{%- endfor -%}\n"
5570
+
"\n"
5571
+
"{%- for message in messages -%}\n"
5572
+
" {%- set content = render_content(message.content) -%}\n"
5573
+
" {%- if (message.role == 'user') or (message.role == 'system' and not loop.first) -%}\n"
5574
+
" {%- set role_name = 'observation' if (message.role == 'system' and not loop.first and message.name == 'observation') else message.role -%}\n"
" {%- if loop.first or (messages[loop.index0 - 1].role != 'tool') -%}\n"
5614
+
" {{- '<|im_start|>tool_response' -}}\n"
5615
+
" {%- endif -%}\n"
5616
+
" {{- '\\n<tool_response>\\n' -}}\n"
5617
+
" {{- content -}}\n"
5618
+
" {{- '\\n</tool_response>' -}}\n"
5619
+
" {%- if loop.last or (messages[loop.index0 + 1].role != 'tool') -%}\n"
5620
+
" {{- '<|im_end|>\\n' -}}\n"
5621
+
" {%- endif -%}\n"
5622
+
" {%- endif -%}\n"
5623
+
"{%- endfor -%}\n"
5624
+
"{%- if add_generation_prompt -%}\n"
5625
+
" {{- '<|im_start|>assistant\\n<think>\\n\\n</think>\\n' if (enable_thinking is defined and not enable_thinking) else '<|im_start|>assistant\\n<think>' -}}\n"
0 commit comments