{% if prompt_libraries is defined %} {% endif %}
{{ tab_config.title if tab_config else tab_name|title }} Configuration
{% if tab_config and tab_config.description %}

{{ tab_config.description }}

{% endif %}
{% set disabled_args = fields | selectattr('disabled') | map(attribute='arg_name') | reject('equalto', None) | list %} {% if disabled_args %} {% endif %} {% if sections %} {% for section in sections %} {% set section_fields = fields | selectattr('section_id', 'equalto', section.id) | list %} {% set has_parent = section_fields[0].get('parent_section') if section_fields else false %} {% if not has_parent %}
{% if section.icon %}{% endif %} {{ section.title }} {% if section.get('advanced') %} Advanced {% endif %}
{% if section.description %}

{{ section.description }}

{% endif %} {% if tab_name == 'validation' and section.id == 'prompt_management' %}
Prompt controls disabled.
Dataset caption driven validation is active; prompts are managed automatically for this model.
{% endif %} {% if section.get('template') %}
{% include section.template %}
{% elif section_fields %} {% set subsections = {} %} {% for field in section_fields %} {% set subsection_name = field.get('subsection', 'general') %} {% if subsection_name not in subsections %} {% set _ = subsections.update({subsection_name: []}) %} {% endif %} {% set _ = subsections[subsection_name].append(field) %} {% endfor %}
{% for subsection_name, subsection_fields in subsections.items() %} {% if subsections|length > 1 and subsection_name != 'general' %}
{{ subsection_name | title | replace('_', ' ') }}
{% endif %} {% for field in subsection_fields %} {% include 'partials/form_field_htmx.html' %} {% endfor %} {% if not loop.last and subsections|length > 1 %}

{% endif %} {% endfor %}
{% elif section.empty_message %}
{{ section.empty_message }}
{% endif %} {% for subsection in sections %} {% set subsection_fields = fields | selectattr('section_id', 'equalto', subsection.id) | list %} {% set subsection_parent = subsection_fields[0].get('parent_section') if subsection_fields else false %} {% if subsection_parent == section.id %}
{% if subsection.icon %}{% endif %} {{ subsection.title }} Advanced
{% if subsection.description %}

{{ subsection.description }}

{% endif %} {% if subsection.get('template') %}
{% include subsection.template %}
{% elif subsection_fields %}
{% for field in subsection_fields %} {% include 'partials/form_field_htmx.html' %} {% endfor %}
{% elif subsection.empty_message %}
{{ subsection.empty_message }}
{% endif %}
{% endif %} {% endfor %}
{% endif %} {% endfor %} {% set unsectioned_fields = fields | selectattr('section_id', 'undefined') | list %} {% if unsectioned_fields %}
{% for field in unsectioned_fields %} {% include 'partials/form_field_htmx.html' %} {% endfor %}
{% endif %} {% else %}
{% for field in fields %} {% include 'partials/form_field_htmx.html' %} {% endfor %}
{% endif %}