1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 03:24:20 +00:00

🔧 Define Conversation as a Protocol

This commit is contained in:
Steffo 2020-12-27 20:48:44 +01:00
parent 2b48eae60c
commit 1060594ef8

View file

@ -11,6 +11,9 @@ from typing import *
# noinspection PyUnresolvedReferences
from typing import IO, TextIO, BinaryIO
if TYPE_CHECKING:
from royalnet.engineer import Sentry
JSONScalar = Union[
None,
@ -76,4 +79,6 @@ An async generator yielding either:
"""
Conversation = Callable[["Sentry", ...], Awaitable[Optional["Conversation"]]]
class Conversation(Protocol):
def __call__(self, _sentry: "Sentry", **kwargs) -> Awaitable["Conversation"]:
...