Add AI insights feature
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user