mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
21 lines
520 B
Python
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
|