feat: update glm.jinja with v3.0 soft-spectrum and regular mode
Browse files- templates/glm.jinja +16 -3
templates/glm.jinja
CHANGED
|
@@ -96,6 +96,16 @@ Operational Protocol — The Deep Research Standard:
|
|
| 96 |
- Protocol 4 (Multi-Candidate Evaluation Matrix): Formulate 2 to 3 candidate architectures. Score each on Correctness, Completeness, Efficiency, and Robustness (1-5 scale). Document the winning trade-off.
|
| 97 |
- Protocol 5 (Master Deliverable Synthesis): Present the definitive final result with unmatched thoroughness, clear structure, and complete implementation.
|
| 98 |
{%- endset -%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
{%- set store = namespace(reasoning_effort=reasoning_effort|default(''), enable_thinking=enable_thinking|default(true)) -%}
|
| 100 |
{%- for msg in messages -%}
|
| 101 |
{%- set txt = msg.content if msg.content is string else '' -%}
|
|
@@ -116,7 +126,7 @@ Operational Protocol — The Deep Research Standard:
|
|
| 116 |
{%- endfor -%}
|
| 117 |
{%- set target_mode = store.reasoning_effort | default(thinking_level|default('7')) | string | lower | trim -%}
|
| 118 |
{%- set current_thinking = store.enable_thinking -%}
|
| 119 |
-
{%- if target_mode in ['0', 'mortal', 'disabled', 'none', 'off', 'zero', 'direct', 'chat'] -%}
|
| 120 |
{%- set current_thinking = false -%}
|
| 121 |
{%- set reasoning_instructions = '' -%}
|
| 122 |
{%- elif target_mode in ['1', 'hermes', 'ulow', 'ultra-low', 'micro', 'minimal'] -%}
|
|
@@ -194,9 +204,12 @@ For each function call, output the function name and arguments within the follow
|
|
| 194 |
{%- macro emit_image() -%}<|begin_of_image|><|image|><|end_of_image|>{%- endmacro -%}
|
| 195 |
{%- macro emit_video() -%}<|begin_of_video|><|video|><|end_of_video|>{%- endmacro -%}
|
| 196 |
{%- macro emit_audio() -%}<|begin_of_audio|><|end_of_audio|>{%- endmacro -%}
|
|
|
|
|
|
|
|
|
|
| 197 |
{%- macro visible_text(content) -%}
|
| 198 |
{%- if content is string -%}
|
| 199 |
-
{{- content -}}
|
| 200 |
{%- elif content is iterable and content is not mapping -%}
|
| 201 |
{%- for item in content -%}
|
| 202 |
{%- if item is mapping and item.type == 'text' -%}
|
|
@@ -394,5 +407,5 @@ For each function call, output the function name and arguments within the follow
|
|
| 394 |
{%- endif -%}
|
| 395 |
{%- endfor -%}
|
| 396 |
{%- if add_generation_prompt -%}
|
| 397 |
-
{% if not current_thinking %}<|assistant|>{{ '<think></think>' }}{% else %}<|assistant|>{{ '<think>' }}{% endif %}
|
| 398 |
{%- endif -%}
|
|
|
|
| 96 |
- Protocol 4 (Multi-Candidate Evaluation Matrix): Formulate 2 to 3 candidate architectures. Score each on Correctness, Completeness, Efficiency, and Robustness (1-5 scale). Document the winning trade-off.
|
| 97 |
- Protocol 5 (Master Deliverable Synthesis): Present the definitive final result with unmatched thoroughness, clear structure, and complete implementation.
|
| 98 |
{%- endset -%}
|
| 99 |
+
{%- set reg_ns = namespace(active=false) %}
|
| 100 |
+
{%- if (regular is defined and regular) or (mode is defined and mode in ('regular', 'vanilla', 'standard', 'default', 'clean')) %}
|
| 101 |
+
{%- set reg_ns.active = true %}
|
| 102 |
+
{%- endif %}
|
| 103 |
+
{%- for msg in messages %}
|
| 104 |
+
{%- if msg.content is string and ('[regular]' in msg.content or '[REGULAR]' in msg.content or '[vanilla]' in msg.content or '[standard]' in msg.content or '[default]' in msg.content) %}
|
| 105 |
+
{%- set reg_ns.active = true %}
|
| 106 |
+
{%- endif %}
|
| 107 |
+
{%- endfor %}
|
| 108 |
+
{%- set is_explicit_regular = reg_ns.active %}
|
| 109 |
{%- set store = namespace(reasoning_effort=reasoning_effort|default(''), enable_thinking=enable_thinking|default(true)) -%}
|
| 110 |
{%- for msg in messages -%}
|
| 111 |
{%- set txt = msg.content if msg.content is string else '' -%}
|
|
|
|
| 126 |
{%- endfor -%}
|
| 127 |
{%- set target_mode = store.reasoning_effort | default(thinking_level|default('7')) | string | lower | trim -%}
|
| 128 |
{%- set current_thinking = store.enable_thinking -%}
|
| 129 |
+
{%- if is_explicit_regular or target_mode in ['0', 'mortal', 'disabled', 'none', 'off', 'zero', 'direct', 'chat', 'regular', 'vanilla', 'standard', 'default', 'clean'] -%}
|
| 130 |
{%- set current_thinking = false -%}
|
| 131 |
{%- set reasoning_instructions = '' -%}
|
| 132 |
{%- elif target_mode in ['1', 'hermes', 'ulow', 'ultra-low', 'micro', 'minimal'] -%}
|
|
|
|
| 204 |
{%- macro emit_image() -%}<|begin_of_image|><|image|><|end_of_image|>{%- endmacro -%}
|
| 205 |
{%- macro emit_video() -%}<|begin_of_video|><|video|><|end_of_video|>{%- endmacro -%}
|
| 206 |
{%- macro emit_audio() -%}<|begin_of_audio|><|end_of_audio|>{%- endmacro -%}
|
| 207 |
+
{%- macro strip_ctrl(t) -%}
|
| 208 |
+
{{- t | replace('[regular]', '') | replace('[REGULAR]', '') | replace('[vanilla]', '') | replace('[standard]', '') | replace('[default]', '') -}}
|
| 209 |
+
{%- endmacro -%}
|
| 210 |
{%- macro visible_text(content) -%}
|
| 211 |
{%- if content is string -%}
|
| 212 |
+
{{- strip_ctrl(content) -}}
|
| 213 |
{%- elif content is iterable and content is not mapping -%}
|
| 214 |
{%- for item in content -%}
|
| 215 |
{%- if item is mapping and item.type == 'text' -%}
|
|
|
|
| 407 |
{%- endif -%}
|
| 408 |
{%- endfor -%}
|
| 409 |
{%- if add_generation_prompt -%}
|
| 410 |
+
{% if is_explicit_regular %}<|assistant|>{% elif not current_thinking %}<|assistant|>{{ '<think></think>' }}{% else %}<|assistant|>{{ '<think>' }}{% endif %}
|
| 411 |
{%- endif -%}
|