xiaozhi-esp32-server/main/xiaozhi-server/core/handle/textMessageHandler.py
Alireza Jahanshahlou 6aedb3c3f5 handle
2025-10-17 01:02:26 +03:30

21 lines
520 B
Python

from abc import abstractmethod, ABC
from typing import Dict, Any
from core.handle.textMessageType import TextMessageType
TAG = __name__
class TextMessageHandler(ABC):
"""Message processor abstract base class"""
@abstractmethod
async def handle(self, conn, msg_json: Dict[str, Any]) -> None:
"""Abstract methods for processing messages"""
pass
@property
@abstractmethod
def message_type(self) -> TextMessageType:
"""Returns the message type processed"""
pass