Spaces:
Runtime error
Runtime error
File size: 1,214 Bytes
1ffd0a4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | """
EscalationResult — output contract for Phase 11's NGO escalation service.
Consumed by:
Phase 12 for simulation context
Phase 13 agent trace log (ngos_alerted field)
Mobile agent-trace timeline (escalation step)
"""
from __future__ import annotations
from pydantic import BaseModel, ConfigDict
class EscalationResult(BaseModel):
"""Outcome of the NGO escalation evaluation for a confirmed crisis.
Attributes:
escalated: True iff at least one NGO FCM notification was sent.
reason: One sentence explaining why escalation did or did not
fire. Rendered in the agent-trace UI.
ngos_alerted: Names of NGOs that received a push notification.
Empty when escalated=False.
severity_score: The SituationReport.severity value evaluated against
the threshold.
threshold_used: The NGO_ESCALATION_THRESHOLD constant in effect when
this result was produced.
"""
model_config = ConfigDict(frozen=True, extra="forbid")
escalated: bool
reason: str
ngos_alerted: list[str]
severity_score: int
threshold_used: int
|