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

18 lines
469 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 ChannelStreamingProtocol(Protocol):
@property
def streaming_modes(self) -> list[str]: ...
@property
def block_streaming(self) -> bool: ...
async def send_stream_chunk(self, chat_id: str, msg_id: str, chunk: str, finished: bool) -> DeliveryResult: ...