Download src/runtime/cdm_runtime.py from DiabetesCareChatbot/dmChatbotBackend: direct link, hf CLI and curl.
- Browser
- Download file 615 Bytes
-
https://huggingface.co/spaces/DiabetesCareChatbot/dmChatbotBackend/resolve/main/src/runtime/cdm_runtime.py
- Command line
-
hf download hf://spaces/DiabetesCareChatbot/dmChatbotBackend/src/runtime/cdm_runtime.py
-
curl -L -o cdm_runtime.py https://huggingface.co/spaces/DiabetesCareChatbot/dmChatbotBackend/resolve/main/src/runtime/cdm_runtime.py
615 Bytes
| from __future__ import annotations | |
| from dataclasses import dataclass, field | |
| from typing import Any, Dict | |
| class TrendAnalysis: | |
| """Deterministic CDM output passed to the coaching skill.""" | |
| summary: str | |
| metrics: Dict[str, Any] = field(default_factory=dict) | |
| def as_dict(self) -> Dict[str, Any]: | |
| return {"trend_analysis": self.summary, "trend_data": self.metrics} | |
| def trend_analysis_from_state(state: Dict[str, Any]) -> TrendAnalysis: | |
| return TrendAnalysis( | |
| summary=state.get("trend_analysis") or "", | |
| metrics=state.get("trend_data") or {}, | |
| ) | |