tokenizer.chat_template.systemone
{%- set Q = {"pending_work": {"type": "noul", "keys": ["yes", "no"], "field": "message", "hint": "--ask pending_work"}, "file.critical": {"type": "noul", "keys": ["yes", "no"], "field": "path", "hint": "--ask file.critical"}, "qa.kind": {"type": "choice", "keys": ["trace", "overview", "general"], "field": "question", "hint": "--ask qa.kind --choice trace --choice overview --choice general"}, "completion.intent": {"type": "choice", "keys": ["unfinished", "finished"], "field": "message", "hint": "--ask completion.intent --choice unfinished --choice finished"}, "web.continuation": {"type": "choice", "keys": ["unfinished", "finished"], "field": "message", "hint": "--ask web.continuation --choice unfinished --choice finished"}, "ask.redundant": {"type": "noul", "keys": ["yes", "no"], "field": "question", "hint": "--ask ask.redundant"}, "stuck": {"type": "noul", "keys": ["yes", "no"], "field": "command", "hint": "--ask stuck"}, "quality": {"type": "choice", "keys": ["usable", "navigation_only", "incomplete", "auth_or_challenge", "unknown"], "field": "page_text", "hint": "--ask quality --choice usable --choice navigation_only --choice incomplete --choice auth_or_challenge --choice unknown"}, "graph.edge_intent": {"type": "choice", "keys": ["incoming", "outgoing", "none"], "field": "query", "hint": "--ask graph.edge_intent --choice incoming --choice outgoing --choice none"}, "task.hard_work": {"type": "choice", "keys": ["routine", "hard"], "field": "task", "hint": "--ask task.hard_work --choice routine --choice hard"}, "provider.failure_kind": {"type": "choice", "keys": ["quota", "rate_limit", "auth", "model_unavailable", "overloaded", "timeout", "context_overflow", "content_filter", "unknown"], "field": "error", "hint": "--ask provider.failure_kind --choice quota --choice rate_limit --choice auth --choice model_unavailable --choice overloaded --choice timeout --choice context_overflow --choice content_filter --choice unknown"}, "error.kind": {"type": "choice", "keys": ["api_rate_limit", "api_overloaded", "api_auth", "tool_timeout", "permission_denied", "file_not_found", "network_error", "context_overflow", "unknown"], "field": "error_message", "hint": "--ask error.kind --choice api_rate_limit --choice api_overloaded --choice api_auth --choice tool_timeout --choice permission_denied --choice file_not_found --choice network_error --choice context_overflow --choice unknown"}, "tool.activity_label": {"type": "choice", "keys": ["candidate", "inspecting", "editing", "searching", "verifying", "coordinating", "integrating", "advancing"], "field": "tool", "hint": "--ask tool.activity_label --choice candidate --choice inspecting --choice editing --choice searching --choice verifying --choice coordinating --choice integrating --choice advancing"}, "verification": {"type": "choice", "keys": ["verified", "not_verified"], "field": "output", "hint": "--ask verification --choice verified --choice not_verified"}} -%}{%- set ALIAS = {} -%}{%- set asked = (instructions if instructions is string else '') | trim -%}{%- set low = asked | lower -%}{%- if id in Q -%}{%- set q = id -%}{%- elif asked in Q -%}{%- set q = asked -%}{%- elif low in ALIAS -%}{%- set q = ALIAS[low] -%}{%- else -%}{{ raise_exception('Knack only answers its 14 trained questions, so it cannot answer "' ~ asked ~ '". Ask one by id or phrasing, for example --ask long_running or --ask "Will it keep running?". All questions: https://ollama.com/devshub/knack') }}{%- endif -%}{%- set spec = Q[q] -%}{%- set yesno = spec['keys'] | length == 2 and spec['keys'][0] == 'yes' -%}{%- if not (type == spec['type'] or (type == 'noul' and yesno)) or options | length != spec['keys'] | length -%}{{ raise_exception('Knack question ' ~ q ~ ' must be asked as: ollama run devshub/knack ' ~ spec['hint']) }}{%- endif -%}{%- if type == 'choice' -%}{%- for o in options -%}{%- if o.key != spec['keys'][loop.index0] -%}{{ raise_exception('Knack question ' ~ q ~ ' needs its options in this order: ' ~ spec['hint']) }}{%- endif -%}{%- endfor -%}{%- endif -%}{{ '<|im_start|>user\n' }}{%- if state is mapping -%}{%- for k, v in state.items() -%}{{ k ~ ': ' }}{%- if v is string -%}{{ v }}{%- else -%}{{ v | tojson }}{%- endif -%}{%- if not loop.last -%}{{ '\n' }}{%- endif -%}{%- endfor -%}{%- else -%}{%- set s = (state if state is string else state | tojson) | trim -%}{%- if s.startswith(spec['field'] ~ ':') or s.startswith('command:') or s.startswith('prompt:') -%}{{ s }}{%- elif spec['field'] == 'command' -%}{{ 'command: ' ~ s ~ '\ndescription: ' }}{%- elif spec['field'] == 'prompt' -%}{{ 'prompt: ' ~ s ~ '\n' ~ "current_mode: build\nrecent_activity: none\nconversation_size: unknown\nopen_task: none\nturns_on_open_task: 0\ninterrupted_work: none\nbrowser_context: false" }}{%- else -%}{{ spec['field'] ~ ': ' ~ s }}{%- endif -%}{%- endif -%}{{ '<|im_end|>\n<|im_start|>assistant\n' ~ q ~ ':' }}
{%- set Q = {"pending_work": {"type": "noul", "keys": ["yes", "no"], "field": "message", "hint": "--ask pending_work"}, "file.critical": {"type": "noul", "keys": ["yes", "no"], "field": "path", "hint": "--ask file.critical"}, "qa.kind": {"type": "choice", "keys": ["trace", "overview", "general"], "field": "question", "hint": "--ask qa.kind --choice trace --choice overview --choice general"}, "completion.intent": {"type": "choice", "keys": ["unfinished", "finished"], "field": "message", "hint": "--ask completion.intent --choice unfinished --choice finished"}, "web.continuation": {"type": "choice", "keys": ["unfinished", "finished"], "field": "message", "hint": "--ask web.continuation --choice unfinished --choice finished"}, "ask.redundant": {"type": "noul", "keys": ["yes", "no"], "field": "question", "hint": "--ask ask.redundant"}, "stuck": {"type": "noul", "keys": ["yes", "no"], "field": "command", "hint": "--ask stuck"}, "quality": {"type": "choice", "keys": ["usable", "navigation_only", "incomplete", "auth_or_challenge", "unknown"], "field": "page_text", "hint": "--ask quality --choice usable --choice navigation_only --choice incomplete --choice auth_or_challenge --choice unknown"}, "graph.edge_intent": {"type": "choice", "keys": ["incoming", "outgoing", "none"], "field": "query", "hint": "--ask graph.edge_intent --choice incoming --choice outgoing --choice none"}, "task.hard_work": {"type": "choice", "keys": ["routine", "hard"], "field": "task", "hint": "--ask task.hard_work --choice routine --choice hard"}, "provider.failure_kind": {"type": "choice", "keys": ["quota", "rate_limit", "auth", "model_unavailable", "overloaded", "timeout", "context_overflow", "content_filter", "unknown"], "field": "error", "hint": "--ask provider.failure_kind --choice quota --choice rate_limit --choice auth --choice model_unavailable --choice overloaded --choice timeout --choice context_overflow --choice content_filter --choice unknown"}, "error.kind": {"type": "choice", "keys": ["api_rate_limit", "api_overloaded", "api_auth", "tool_timeout", "permission_denied", "file_not_found", "network_error", "context_overflow", "unknown"], "field": "error_message", "hint": "--ask error.kind --choice api_rate_limit --choice api_overloaded --choice api_auth --choice tool_timeout --choice permission_denied --choice file_not_found --choice network_error --choice context_overflow --choice unknown"}, "tool.activity_label": {"type": "choice", "keys": ["candidate", "inspecting", "editing", "searching", "verifying", "coordinating", "integrating", "advancing"], "field": "tool", "hint": "--ask tool.activity_label --choice candidate --choice inspecting --choice editing --choice searching --choice verifying --choice coordinating --choice integrating --choice advancing"}, "verification": {"type": "choice", "keys": ["verified", "not_verified"], "field": "output", "hint": "--ask verification --choice verified --choice not_verified"}} -%}{%- set ALIAS = {} -%}{%- set asked = (instructions if instructions is string else '') | trim -%}{%- set low = asked | lower -%}{%- if id in Q -%}{%- set q = id -%}{%- elif asked in Q -%}{%- set q = asked -%}{%- elif low in ALIAS -%}{%- set q = ALIAS[low] -%}{%- else -%}{{ raise_exception('Knack only answers its 14 trained questions, so it cannot answer "' ~ asked ~ '". Ask one by id or phrasing, for example --ask long_running or --ask "Will it keep running?". All questions: https://ollama.com/devshub/knack') }}{%- endif -%}{%- set spec = Q[q] -%}{%- set yesno = spec['keys'] | length == 2 and spec['keys'][0] == 'yes' -%}{%- if not (type == spec['type'] or (type == 'noul' and yesno)) or options | length != spec['keys'] | length -%}{{ raise_exception('Knack question ' ~ q ~ ' must be asked as: ollama run devshub/knack ' ~ spec['hint']) }}{%- endif -%}{%- if type == 'choice' -%}{%- for o in options -%}{%- if o.key != spec['keys'][loop.index0] -%}{{ raise_exception('Knack question ' ~ q ~ ' needs its options in this order: ' ~ spec['hint']) }}{%- endif -%}{%- endfor -%}{%- endif -%}{{ '<|im_start|>user\n' }}{%- if state is mapping -%}{%- for k, v in state.items() -%}{{ k ~ ': ' }}{%- if v is string -%}{{ v }}{%- else -%}{{ v | tojson }}{%- endif -%}{%- if not loop.last -%}{{ '\n' }}{%- endif -%}{%- endfor -%}{%- else -%}{%- set s = (state if state is string else state | tojson) | trim -%}{%- if s.startswith(spec['field'] ~ ':') or s.startswith('command:') or s.startswith('prompt:') -%}{{ s }}{%- elif spec['field'] == 'command' -%}{{ 'command: ' ~ s ~ '\ndescription: ' }}{%- elif spec['field'] == 'prompt' -%}{{ 'prompt: ' ~ s ~ '\n' ~ "current_mode: build\nrecent_activity: none\nconversation_size: unknown\nopen_task: none\nturns_on_open_task: 0\ninterrupted_work: none\nbrowser_context: false" }}{%- else -%}{{ spec['field'] ~ ': ' ~ s }}{%- endif -%}{%- endif -%}{{ '<|im_end|>\n<|im_start|>assistant\n' ~ q ~ ':' }}