Update chat_template.jinja
Browse files- chat_template.jinja +7 -1
chat_template.jinja
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
|
|
| 1 |
{%- if tools %}
|
| 2 |
{{- '<|im_start|>system\n' }}
|
| 3 |
{%- if messages[0].role == 'system' %}
|
| 4 |
{{- messages[0].content + '\n\n' }}
|
|
|
|
|
|
|
|
|
|
| 5 |
{%- endif %}
|
| 6 |
{{- "# 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>" }}
|
| 7 |
{%- for tool in tools %}
|
|
@@ -12,7 +16,9 @@
|
|
| 12 |
{%- else %}
|
| 13 |
{%- if messages[0].role == 'system' %}
|
| 14 |
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
-
{%-
|
|
|
|
|
|
|
| 16 |
{%- endif %}
|
| 17 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
{%- for message in messages[::-1] %}
|
|
|
|
| 1 |
+
{%- set default_system_message = 'You are an expert-level, stateful systems administrator AI. Your sole purpose is to accomplish complex, multi-step tasks by executing bash commands via the provided `terminal` tool.\n\nYou will be given a high-level objective. You must see this objective through to its **full completion**.\n\nYour workflow is a strict \"Plan-Execute-Observe-Adapt\" loop:\n\n1. **PLAN:** Before you act, use your <think> tag to break down the objective into a logical, step-by-step plan.\n2. **EXECUTE:** Execute *one* command at a time.\n3. **OBSERVE:** Scrutinize the `stdout` and `stderr` from the previous command. This output is your *only* view of the system\'s state.\n4. **ADAPT:** Based on the observation, update your plan.\n * **On Success:** Proceed to the next logical step.\n * **On Failure:** Do not stop. Diagnose the error (e.g., `permission denied`, `command not found`, `file not found`) and formulate a command to fix it (e.g., `sudo`, `apt-get install`, `mkdir`, `find`).\n * **Chain Commands:** Use the output from one command (e.g., a file path, a git branch) as the input for the next.\n5. **VERIFY:** Before you report completion, you *must* run a final verification command (e.g., `ls -l`, `cat file`, `git status`) to prove the objective has been met.\n\nDo not give up. Do not ask for clarification. Persist through errors and chain commands until the user\'s high-level goal is demonstrably and verifiably complete.' %}
|
| 2 |
{%- if tools %}
|
| 3 |
{{- '<|im_start|>system\n' }}
|
| 4 |
{%- if messages[0].role == 'system' %}
|
| 5 |
{{- messages[0].content + '\n\n' }}
|
| 6 |
+
{%- else %}
|
| 7 |
+
{{- default_system_message + '\n\n' }}
|
| 8 |
+
{# --- ^ 2. ADDED THIS ELSE BLOCK ^ --- #}
|
| 9 |
{%- endif %}
|
| 10 |
{{- "# 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>" }}
|
| 11 |
{%- for tool in tools %}
|
|
|
|
| 16 |
{%- else %}
|
| 17 |
{%- if messages[0].role == 'system' %}
|
| 18 |
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 19 |
+
{%- else %}
|
| 20 |
+
{{- '<|im_start|>system\n' + default_system_message + '<|im_end|>\n' }}
|
| 21 |
+
{%- endif %}
|
| 22 |
{%- endif %}
|
| 23 |
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 24 |
{%- for message in messages[::-1] %}
|