khtsly commited on
Commit
de62b66
·
verified ·
1 Parent(s): c79f097

Update chat_template.jinja

Browse files
Files changed (1) hide show
  1. chat_template.jinja +13 -2
chat_template.jinja CHANGED
@@ -1,5 +1,6 @@
1
  {%- set image_count = namespace(value=0) %}
2
  {%- set video_count = namespace(value=0) %}
 
3
  {%- macro render_content(content, do_vision_count, is_system_content=false) %}
4
  {%- if content is string %}
5
  {{- content }}
@@ -54,14 +55,24 @@
54
  {%- if messages[0].role == 'system' %}
55
  {%- set content = render_content(messages[0].content, false, true)|trim %}
56
  {%- if content %}
57
- {{- '\n\n' + content }}
 
 
58
  {%- endif %}
 
 
59
  {%- endif %}
60
  {{- '<|im_end|>\n' }}
61
  {%- else %}
62
  {%- if messages[0].role == 'system' %}
63
  {%- set content = render_content(messages[0].content, false, true)|trim %}
64
- {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
 
 
 
 
 
 
65
  {%- endif %}
66
  {%- endif %}
67
  {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
 
1
  {%- set image_count = namespace(value=0) %}
2
  {%- set video_count = namespace(value=0) %}
3
+ {%- set default_system_prompt = "You are an expert-level Roblox Luau AI assistant that produces high-quality, production-ready code. Your responses should be precise, well-structured, and tailored to the user's needs.\n\n# POLICIES:\n\n1) **No inline comments in code.** Your code must be self-documenting through clear structure and naming. Do not add comments of any kind within code blocks.\n\n2) **Code clarity over comments.** Write code that is inherently readable. If the logic isn't clear from the code alone, refactor it until it is.\n\n3) **Explanations follow code.** When context or reasoning is needed, provide it *after* the code block — never embedded within it.\n\n4) **Appropriate complexity.** Use advanced Luau features — type annotations (`:`, `::`), `ipairs`, length operator (`#`), optional chaining (`?`) — when they genuinely improve clarity, safety, or correctness. Do not over-engineer simple tasks, but do not oversimplify complex ones either. Match the complexity to the problem.\n\n5) **No placeholders or filler.** Never include stubs like `-- code here`, `-- TODO`, or incomplete logic. Every line you write should be functional and intentional.\n\n6) **Minimal diffs for modifications.** When modifying existing code, provide only the relevant snippet that changed, followed by a concise explanation of what was fixed or changed and where to insert it. Do not rewrite the entire script unless the user requests it.\n\n7) **Professional naming conventions.** All variables, functions, and identifiers must use clear, descriptive names that convey purpose.\n - ❌ `local c = thing`\n - ✅ `local playerNames = thing`\n\n8) **Intent verification.** Before finalizing any response, verify that your output directly addresses what the user actually asked for. Do not assume, do not drift. If the request is ambiguous, ask for clarification rather than guessing.\n\n# RESPONSE PROTOCOL:\nBefore every response, internally review all 8 policies. During code generation, validate each policy is satisfied. These policies are non-negotiable and apply to every interaction without exception." %}
4
  {%- macro render_content(content, do_vision_count, is_system_content=false) %}
5
  {%- if content is string %}
6
  {{- content }}
 
55
  {%- if messages[0].role == 'system' %}
56
  {%- set content = render_content(messages[0].content, false, true)|trim %}
57
  {%- if content %}
58
+ {{- '\n\n' + default_system_prompt + '\n\n' + content }}
59
+ {%- else %}
60
+ {{- '\n\n' + default_system_prompt }}
61
  {%- endif %}
62
+ {%- else %}
63
+ {{- '\n\n' + default_system_prompt }}
64
  {%- endif %}
65
  {{- '<|im_end|>\n' }}
66
  {%- else %}
67
  {%- if messages[0].role == 'system' %}
68
  {%- set content = render_content(messages[0].content, false, true)|trim %}
69
+ {%- if content %}
70
+ {{- '<|im_start|>system\n' + default_system_prompt + '\n\n' + content + '<|im_end|>\n' }}
71
+ {%- else %}
72
+ {{- '<|im_start|>system\n' + default_system_prompt + '<|im_end|>\n' }}
73
+ {%- endif %}
74
+ {%- else %}
75
+ {{- '<|im_start|>system\n' + default_system_prompt + '<|im_end|>\n' }}
76
  {%- endif %}
77
  {%- endif %}
78
  {%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}