Add AI insights feature

This commit is contained in:
Urtzi Alfaro
2025-12-15 21:14:22 +01:00
parent 5642b5a0c0
commit c566967bea
39 changed files with 17729 additions and 404 deletions

View File

@@ -449,7 +449,7 @@ class UnifiedEventPublisher:
elif event_class == "notification":
routing_key = f"notification.{event_domain}.info"
elif event_class == "recommendation":
routing_key = f"recommendation.{event_domain}.medium"
routing_key = f"recommendation.{event_domain}.{severity or 'medium'}"
else: # business events
routing_key = f"business.{event_type.replace('.', '_')}"
@@ -538,14 +538,16 @@ class UnifiedEventPublisher:
self,
event_type: str,
tenant_id: Union[str, uuid.UUID],
data: Dict[str, Any]
data: Dict[str, Any],
severity: Optional[str] = None
) -> bool:
"""Publish a recommendation (suggestion to user)"""
return await self.publish_event(
event_type=event_type,
tenant_id=tenant_id,
data=data,
event_class="recommendation"
event_class="recommendation",
severity=severity
)