mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 11:29:39 +08:00
26 lines
500 B
Python
26 lines
500 B
Python
from __future__ import annotations
|
|
|
|
import abc
|
|
|
|
from ...core import app
|
|
from ...core import entities as core_entities
|
|
from .. import entities
|
|
|
|
|
|
class MessageHandler(metaclass=abc.ABCMeta):
|
|
|
|
ap: app.Application
|
|
|
|
def __init__(self, ap: app.Application):
|
|
self.ap = ap
|
|
|
|
async def initialize(self):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
async def handle(
|
|
self,
|
|
query: core_entities.Query,
|
|
) -> entities.StageProcessResult:
|
|
raise NotImplementedError
|