{% extends "plants/base.html" %} {% block title %}Diagnosis {{ diagnosis.plant.name }}{% endblock %} {% block content %} {% with out=diagnosis.output %}

{{ diagnosis.plant.name }}: diagnosis

{{ diagnosis.created_at|date:"M j, Y H:i" }} {{ diagnosis.get_mode_display }} {% if out.urgency %}{{ out.urgency }} urgency{% endif %}

Back to plant
{% if diagnosis.notice %}
{{ diagnosis.notice }}
{% endif %}
{% if diagnosis.photo %}Photo of {{ diagnosis.plant.name }}{% endif %}

Symptoms: {{ symptom_labels|join:", "|default:"none ticked" }}

{% if diagnosis.color_stats %}

Foliage colors: {{ diagnosis.color_stats.green_ratio|floatformat:2 }} green / {{ diagnosis.color_stats.yellow_ratio|floatformat:2 }} yellow / {{ diagnosis.color_stats.brown_ratio|floatformat:2 }} brown (share of 1.0)

{% endif %} {% if out.is_plant_identified %}

Identified as: {{ out.species_guess }}

{% endif %} {% if usage %}

{% if usage.cached %}Cached response, no tokens used.{% else %}{{ usage.input_tokens }} in / {{ usage.output_tokens }} out tokens, about ${{ usage.cost_usd|floatformat:5 }}.{% endif %}

{% endif %}

Likely causes

{% for c in out.causes %}
{{ forloop.counter }}. {{ c.name }}{% widthratio c.confidence 1 100 %}%

{{ c.evidence }}

To confirm: {{ c.how_to_confirm }}

{% empty %}

No cause could be ranked. Tick the symptoms you can see and try again.

{% endfor %}

Treatment plan

    {% for s in out.treatment_steps %}
  1. {{ s }}
  2. {% empty %}
  3. No steps.
  4. {% endfor %}

Follow-ups created

Did it recover?

{% csrf_token %} {{ form.as_div }}
{% endwith %} {% endblock %}