Spaces:
Paused
Paused
Download models/platform_insight.py from 3SCError404/miracle: direct link, hf CLI and curl.
- Browser
- Download file 781 Bytes
-
https://huggingface.co/spaces/3SCError404/miracle/resolve/main/models/platform_insight.py
- Command line
-
hf download hf://spaces/3SCError404/miracle/models/platform_insight.py
-
curl -L -o platform_insight.py https://huggingface.co/spaces/3SCError404/miracle/resolve/main/models/platform_insight.py
781 Bytes
| from sqlalchemy import Column, Text, JSON, DateTime | |
| from core.database import Base | |
| from models.base import PrimaryKeyMixin | |
| from datetime import datetime | |
| class PlatformInsight(Base, PrimaryKeyMixin): | |
| """ | |
| Durable cache table for platform-wide strategic insights. | |
| Accessible only by SC_ADMIN (Super Admins). | |
| Updated once a day or manually via explicit forensic trigger. | |
| """ | |
| __tablename__ = "platform_insights" | |
| summary = Column(Text, nullable=False) | |
| # Trends and Topic Clusters (e.g., {"VPN_ERRORS": 45, "SSO_ISSUE": 12}) | |
| trends = Column(JSON, nullable=True) | |
| # Metadata for the insight generation | |
| metrics_snapshot = Column(JSON, nullable=True) | |
| updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow) | |