{% extends "base.html" %} {% block title %}Recommended News - DS Task AI News{% endblock %} {% block content %}

AI Insights

{% if insights %} {% if insights is string %} {# If insights is a string (JSON or markdown), try to parse it #} {% set insights_data = insights | from_json %} {% if insights_data %}
{% if insights_data.themes %}

Themes

    {% for theme in insights_data.themes %}
  • {{ theme }}
  • {% endfor %}
{% endif %} {% if insights_data.insights %}

Key Insights

    {% for insight in insights_data.insights %}
  • {{ insight }}
  • {% endfor %}
{% endif %} {% if insights_data.implications %}

Implications

    {% for implication in insights_data.implications %}
  • {{ implication }}
  • {% endfor %}
{% endif %} {% if insights_data.related_areas %}

Related Areas

{% for area in insights_data.related_areas %} {{ area }} {% endfor %}
{% endif %}
{% else %} {# If parsing failed, display the raw insights #}
{{ insights }}
{% endif %} {% else %} {# If insights is already a dict/object #}
{% if insights.themes %}

Themes

    {% for theme in insights.themes %}
  • {{ theme }}
  • {% endfor %}
{% endif %} {% if insights.insights %}

Key Insights

    {% for insight in insights.insights %}
  • {{ insight }}
  • {% endfor %}
{% endif %} {% if insights.implications %}

Implications

    {% for implication in insights.implications %}
  • {{ implication }}
  • {% endfor %}
{% endif %} {% if insights.related_areas %}

Related Areas

{% for area in insights.related_areas %} {{ area }} {% endfor %}
{% endif %}
{% endif %} {% else %}

No insights available for these articles.

{% endif %}

Recommended Articles

{% for article in articles %}

{{ article.title }}

{{ article.content[:200] }}...

{{ article.source }} {{ article.published }}
{% if article.categories %}
{% for category in article.categories %} {{ category }} {% endfor %}
{% endif %}
{% endfor %}
{% endblock %}