nicholasKluge commited on
Commit
b4bd31b
·
verified ·
1 Parent(s): 3f3f82a

Update chat_template.jinja

Browse files
Files changed (1) hide show
  1. chat_template.jinja +5 -5
chat_template.jinja CHANGED
@@ -1,5 +1,5 @@
1
  {%- if tools %}
2
- {{- '### Sistema\n' }}
3
  {%- if messages[0].role == 'system' %}
4
  {{- messages[0].content + '\n\n' }}
5
  {%- endif %}
@@ -11,7 +11,7 @@
11
  {{- "\n</tools>\n\nPara cada chamada de função, retorne um objeto json com o nome da função e os argumentos dentro das tags XML <tool_call></tool_call>:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call>\n" }}
12
  {%- else %}
13
  {%- if messages[0].role == 'system' %}
14
- {{- '### Sistema\n' + messages[0].content + '\n' }}
15
  {%- endif %}
16
  {%- endif %}
17
  {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
@@ -29,7 +29,7 @@
29
  {%- set content = '' %}
30
  {%- endif %}
31
  {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
32
- {{- '### ' + message.role.replace('user', 'Usuário').replace('assistant', 'Assistente').replace('tool', 'Ferramenta') + '\n' + content + '\n' }}
33
  {%- elif message.role == "assistant" %}
34
  {%- set reasoning_content = '' %}
35
  {%- if message.reasoning_content is string %}
@@ -40,7 +40,7 @@
40
  {%- endif %}
41
  {%- endif %}
42
 
43
- {{- '### ' + message.role.replace('user', 'Usuário').replace('assistant', 'Assistente').replace('tool', 'Ferramenta') + '\n'}}
44
  {%- if loop.index0 > ns.last_query_index %}
45
  {%- if not loop.last and reasoning_content %}
46
  {{- '<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
@@ -72,7 +72,7 @@
72
  {{- '\n' }}
73
  {%- elif message.role == "tool" %}
74
  {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
75
- {{- '### Usuário' }}
76
  {%- endif %}
77
  {{- '\n<tool_response>\n' }}
78
  {{- content }}
 
1
  {%- if tools %}
2
+ {{- '# Sistema\n' }}
3
  {%- if messages[0].role == 'system' %}
4
  {{- messages[0].content + '\n\n' }}
5
  {%- endif %}
 
11
  {{- "\n</tools>\n\nPara cada chamada de função, retorne um objeto json com o nome da função e os argumentos dentro das tags XML <tool_call></tool_call>:\n<tool_call>\n{\"name\": <function-name>, \"arguments\": <args-json-object>}\n</tool_call>\n" }}
12
  {%- else %}
13
  {%- if messages[0].role == 'system' %}
14
+ {{- '# Sistema\n' + messages[0].content + '\n' }}
15
  {%- endif %}
16
  {%- endif %}
17
  {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
 
29
  {%- set content = '' %}
30
  {%- endif %}
31
  {%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
32
+ {{- '# ' + message.role.replace('user', 'Usuário').replace('assistant', 'Assistente').replace('tool', 'Ferramenta') + '\n' + content + '\n' }}
33
  {%- elif message.role == "assistant" %}
34
  {%- set reasoning_content = '' %}
35
  {%- if message.reasoning_content is string %}
 
40
  {%- endif %}
41
  {%- endif %}
42
 
43
+ {{- '# ' + message.role.replace('user', 'Usuário').replace('assistant', 'Assistente').replace('tool', 'Ferramenta') + '\n'}}
44
  {%- if loop.index0 > ns.last_query_index %}
45
  {%- if not loop.last and reasoning_content %}
46
  {{- '<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
 
72
  {{- '\n' }}
73
  {%- elif message.role == "tool" %}
74
  {%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
75
+ {{- '# Usuário' }}
76
  {%- endif %}
77
  {{- '\n<tool_response>\n' }}
78
  {{- content }}