feat: add get_alerts query to LabResultWatcherWorkflow
Build Agents Runtime / build (push) Successful in 1m26s Details

This commit is contained in:
Deep Koluguri 2026-05-22 22:35:38 -04:00
parent a3b214855d
commit fe73cad4e8
1 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,7 @@ class LabResultWatcherWorkflow:
def __init__(self) -> None:
self._pending_lab_results = []
self._is_discharged = False
self._alerts = []
@workflow.signal
def add_lab_result(self, result: str) -> None:
@ -67,6 +68,10 @@ class LabResultWatcherWorkflow:
def discharge_patient(self) -> None:
self._is_discharged = True
@workflow.query
def get_alerts(self) -> list:
return self._alerts
@workflow.run
async def run(self, baseline_data: dict) -> dict:
"""
@ -103,6 +108,7 @@ class LabResultWatcherWorkflow:
anomaly_report,
start_to_close_timeout=timedelta(minutes=1)
)
self._alerts.append(anomaly_report)
alerts_triggered += 1
return {