ForcePilot/backend/package/yuxi/channels/protocols/heartbeat.py

18 lines
535 B
Python
Raw Normal View History

from __future__ import annotations
from typing import TYPE_CHECKING, Protocol, runtime_checkable
if TYPE_CHECKING:
from yuxi.channels.models import DeliveryResult
@runtime_checkable
class ChannelHeartbeatProtocol(Protocol):
async def send_typing_indicator(self, chat_id: str) -> None: ...
async def send_stream_chunk(self, chat_id: str, msg_id: str, chunk: str, finished: bool) -> DeliveryResult: ...
async def check_ready(self) -> bool: ...
async def clear_typing_indicator(self, chat_id: str) -> None: ...