PMFlow/backend/app/services/ai_pmo_intent/models.py

33 lines
682 B
Python

from __future__ import annotations
from .shared import *
def _safe_int(value: Any) -> Optional[int]:
try:
if value is None or value == "":
return None
return int(value)
except (TypeError, ValueError):
return None
class CanonicalIntent:
name: str
confidence: float
project_id: Optional[int]
signal_title: str
signal_summary: str
metadata: dict[str, Any]
class WorkflowRoute:
family: str
action: str
project_id: Optional[int]
requested_count: int
requires_confirmation: bool
metadata: dict[str, Any]
@property
def key(self) -> str:
return f"{self.family}.{self.action}"