File size: 2,663 Bytes
a259d49
 
 
 
 
217efdb
 
 
a259d49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fc0b3f2
a259d49
 
 
 
 
 
 
 
 
 
 
 
217efdb
a259d49
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<|beginoftext|><startofturn|>
{%- set system_messages = messages | selectattr('role', 'equalto', 'system') | list %}
<|system|>
You are a deep thinking AI, you may use extremely long chains of thought to deeply consider the problem and deliberate with yourself via systematic reasoning processes to help come to a correct solution prior to answering. You should enclose your thoughts and internal monologue inside <think> </think> tags, and then provide your solution or response to the problem.
Solve the following problem step by step. Put your final answer inside \\boxed{}.

{% if system_messages %}
    {% for sm in system_messages %}
{{ sm.content }}
    {% endfor %}
{%- endif %}
{% if tools is defined and tools %}

# Tools

You may call one or more functions to assist with the user query.
You are provided with function signatures within <tools></tools> XML tags:
<tools>
{%- for tool in tools %}
{{ tool | tojson }}
{%- if not loop.last %} 
{%- endif %}
{%- endfor %}
</tools>
Use this exact JSON schema for each tool call:
{"properties":{"name":{"title":"Name","type":"string"},"arguments":{"title":"Arguments","type":"object"}},"required":["name","arguments"],"title":"FunctionCall","type":"object"}

For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags as follows:
<tool_call>
{"name": <function-name>, "arguments": <args-dict>}
</tool_call>
{% endif %}
{{ '<|endofturn|>' }}
{%- for message in messages if message.role != "system" -%}
<|startofturn|>
{%- if message.role == "user" -%}
<|user|>
{{ message.content }}
<|endofturn|>{%- elif message.role == "assistant" -%}
<|assistant|>
{%- set raw_calls = (message.tool_calls if (message.tool_calls is defined and message.tool_calls) else message.tool_call) %}
{%- if raw_calls %}
{%- set tool_calls = (raw_calls if (raw_calls is iterable and (raw_calls is not mapping) and (raw_calls is not string)) else [raw_calls]) %}
{%- for tc in tool_calls %}
{%- set call = (tc.function if tc.function is defined else tc) %}
<tool_call>
{"name": "{{ call.name }}", "arguments": {{ call.arguments if call.arguments is string else (call.arguments|default({})|tojson) }}}
</tool_call>
{%- endfor %}
{%- endif %}
{%- if message.thinking is defined and message.thinking and not add_generation_prompt %}
{{ '<think>' }}
{{ message.thinking }}
{{ '</think>' }}
{% endif %}
{{ message.content }}
<|endofturn|>{%- elif message.role == "tool" -%}
<|tool|>
<tool_response>
{{ message.content }}
</tool_response><|endofturn|>
{%- endif -%}
{%- endfor -%}
{%- if add_generation_prompt %}
{{- '<|assistant|><think>\n' }}
{%- else %}
<|endoftext|>
{%- endif %}