mirror of
https://github.com/omnara-ai/omnara.git
synced 2025-08-12 20:39:09 +03:00
* twilio * phone number validation * enforce user preference --------- Co-authored-by: Kartik Sarangmath <kartiksarangmath@Kartiks-MacBook-Air.local>
51 lines
1.3 KiB
Python
51 lines
1.3 KiB
Python
"""Abstract base class for notification services"""
|
|
|
|
from abc import ABC, abstractmethod
|
|
from typing import Dict, Union
|
|
from uuid import UUID
|
|
from sqlalchemy.orm import Session
|
|
|
|
|
|
class NotificationServiceBase(ABC):
|
|
"""Abstract base class defining the interface for notification services"""
|
|
|
|
@abstractmethod
|
|
def send_notification(
|
|
self, db: Session, user_id: UUID, title: str, body: str, **kwargs
|
|
) -> Union[bool, Dict[str, bool]]:
|
|
"""Send a general notification
|
|
|
|
Returns:
|
|
bool for single-channel services (push)
|
|
Dict[str, bool] for multi-channel services (email/SMS)
|
|
"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
def send_question_notification(
|
|
self,
|
|
db: Session,
|
|
user_id: UUID,
|
|
instance_id: str,
|
|
question_id: str,
|
|
agent_name: str,
|
|
question_text: str,
|
|
**kwargs,
|
|
) -> Union[bool, Dict[str, bool]]:
|
|
"""Send notification for a new agent question"""
|
|
pass
|
|
|
|
@abstractmethod
|
|
async def send_step_notification(
|
|
self,
|
|
db: Session,
|
|
user_id: UUID,
|
|
instance_id: str,
|
|
step_number: int,
|
|
agent_name: str,
|
|
step_description: str,
|
|
**kwargs,
|
|
) -> Union[bool, Dict[str, bool]]:
|
|
"""Send notification for a new agent step"""
|
|
pass
|