CoACT initialize (#292)

This commit is contained in:
Linxin Song
2025-07-30 19:35:20 -07:00
committed by GitHub
parent 862d704b8c
commit b968155757
228 changed files with 42386 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
# Copyright (c) 2023 - 2025, AG2ai, Inc., AG2ai open-source projects maintainers and core contributors
#
# SPDX-License-Identifier: Apache-2.0
from collections.abc import AsyncIterator
from typing import Any, Protocol, runtime_checkable
__all__ = ["WebSocketProtocol"]
@runtime_checkable
class WebSocketProtocol(Protocol):
"""WebSocket protocol for sending and receiving JSON data modelled after FastAPI's WebSocket."""
async def send_json(self, data: Any, mode: str = "text") -> None: ...
async def receive_json(self, mode: str = "text") -> Any: ...
async def receive_text(self) -> str: ...
def iter_text(self) -> AsyncIterator[str]: ...