{# AI Intent + AI Change Summary section — shared include for watch edit and tag/group edit. Required template context: llm_configured — bool: LLM provider is configured in settings form — the WTForms form (must have .llm_intent and .llm_change_summary fields) Optional (watch edit only): watch — the Watch object (for processor check and prefilter display) llm_group_overrides — dict returned by _resolve_llm_group_overrides(): {'llm_intent': {'value': str, 'group_name': str} | None, 'llm_change_summary': {'value': str, 'group_name': str} | None} Present only in watch edit context; absent in tag edit context. Usage in watch edit (edit.html): {% include "edit/include_llm_intent.html" %} Usage in tag edit (edit-tag.html): {% include "edit/include_llm_intent.html" %} (watch is not set → tag mode: no processor check, no examples, different description) #} {% from '_helpers.html' import render_field %} {# Processor check only applies in watch-edit context (llm_group_overrides present). #} {# In tag/group edit context the AI section is always visible. #} {% if llm_group_overrides is defined %} {% set is_text_json_diff = not watch.get('processor') or watch.get('processor') == 'text_json_diff' %} {% else %} {% set is_text_json_diff = true %} {% endif %} {% if is_text_json_diff %} {# ── Configured: show the intent + summary fields ────────────────── #} {% if llm_configured %}
{% if watch is defined and watch %} {{ _('Configure an AI / LLM provider in Settings → AI / LLM to enable AI Change Intent and AI Change Summary.', url=url_for('settings.settings_page') + '#ai') | safe }} {% else %} {{ _('Configure an AI / LLM provider in Settings → AI / LLM to enable AI features for this group.', url=url_for('settings.settings_page') + '#ai') | safe }} {% endif %}