feat: V1 - DAG编排/告警系统/Agent循环/知识库RAG/Webhook + 审核管理富上下文修复
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
"""Alert model - budget warnings, task failures, system events."""
|
||||||
|
from sqlalchemy import Column, String, Integer, Text, Boolean, ForeignKey
|
||||||
|
from app.models.base import Base, TimestampMixin, TenantMixin
|
||||||
|
|
||||||
|
|
||||||
|
class Alert(Base, TimestampMixin, TenantMixin):
|
||||||
|
"""System alerts: budget warnings, task failures, worker offline."""
|
||||||
|
__tablename__ = "alerts"
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
alert_type = Column(String(50), nullable=False) # budget_warning, budget_exceeded, task_failed, worker_offline
|
||||||
|
severity = Column(String(20), nullable=False, default="warning") # info, warning, critical
|
||||||
|
message = Column(Text, nullable=False)
|
||||||
|
project_id = Column(Integer, ForeignKey("projects.id"), nullable=True)
|
||||||
|
worker_id = Column(Integer, ForeignKey("ai_workers.id"), nullable=True)
|
||||||
|
is_read = Column(Boolean, default=False, nullable=False)
|
||||||
Reference in New Issue
Block a user