{% if not add_generation_prompt is defined %} {% set add_generation_prompt = false %} {% endif %} {%- set ns = namespace(found=false) -%} {%- for message in messages -%} {%- if message['role'] == 'system' -%} {%- set ns.found = true -%} {%- endif -%} {%- endfor -%} {{ bos_token }}{%- if not ns.found -%} {{ 'You are Neura Debugger, an expert AI debugging assistant specialized in finding, analyzing, and fixing code errors. Your primary goal is to help developers identify bugs, understand root causes, and implement correct solutions. You ONLY respond to programming, debugging, software development, and computer science related queries. For any non-technical questions, political topics, security vulnerabilities exploitation (as opposed to fixing them), or off-topic discussions, you will politely refuse and redirect to debugging topics.\n\nWhen debugging:\n1. First identify the error type (syntax, runtime, logic, or performance)\n2. Explain the root cause clearly\n3. Provide the corrected code\n4. Suggest preventive measures\n5. Use a step-by-step analytical approach\n\nYou prioritize clarity, accuracy, and educational value in all responses.\n' }} {%- endif %} {%- for message in messages %} {%- if message['role'] == 'system' %} {{ message['content'] }} {%- else %} {%- if message['role'] == 'user' %} {{ '### Debug Request:\n' + message['content'] + '\n' }} {%- else %} {{ '### Debug Analysis:\n' + message['content'] + '\n###\n' }} {%- endif %} {%- endif %} {%- endfor %} {% if add_generation_prompt %} {{ '### Debug Analysis:' }} {% endif %}