remove bare list, dict, Sequence, None, Any (#25058)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@@ -47,7 +47,7 @@ class SSETransport:
|
||||
headers: dict[str, Any] | None = None,
|
||||
timeout: float = 5.0,
|
||||
sse_read_timeout: float = 5 * 60,
|
||||
) -> None:
|
||||
):
|
||||
"""Initialize the SSE transport.
|
||||
|
||||
Args:
|
||||
@@ -76,7 +76,7 @@ class SSETransport:
|
||||
|
||||
return url_parsed.netloc == endpoint_parsed.netloc and url_parsed.scheme == endpoint_parsed.scheme
|
||||
|
||||
def _handle_endpoint_event(self, sse_data: str, status_queue: StatusQueue) -> None:
|
||||
def _handle_endpoint_event(self, sse_data: str, status_queue: StatusQueue):
|
||||
"""Handle an 'endpoint' SSE event.
|
||||
|
||||
Args:
|
||||
@@ -94,7 +94,7 @@ class SSETransport:
|
||||
|
||||
status_queue.put(_StatusReady(endpoint_url))
|
||||
|
||||
def _handle_message_event(self, sse_data: str, read_queue: ReadQueue) -> None:
|
||||
def _handle_message_event(self, sse_data: str, read_queue: ReadQueue):
|
||||
"""Handle a 'message' SSE event.
|
||||
|
||||
Args:
|
||||
@@ -110,7 +110,7 @@ class SSETransport:
|
||||
logger.exception("Error parsing server message")
|
||||
read_queue.put(exc)
|
||||
|
||||
def _handle_sse_event(self, sse: ServerSentEvent, read_queue: ReadQueue, status_queue: StatusQueue) -> None:
|
||||
def _handle_sse_event(self, sse: ServerSentEvent, read_queue: ReadQueue, status_queue: StatusQueue):
|
||||
"""Handle a single SSE event.
|
||||
|
||||
Args:
|
||||
@@ -126,7 +126,7 @@ class SSETransport:
|
||||
case _:
|
||||
logger.warning("Unknown SSE event: %s", sse.event)
|
||||
|
||||
def sse_reader(self, event_source: EventSource, read_queue: ReadQueue, status_queue: StatusQueue) -> None:
|
||||
def sse_reader(self, event_source: EventSource, read_queue: ReadQueue, status_queue: StatusQueue):
|
||||
"""Read and process SSE events.
|
||||
|
||||
Args:
|
||||
@@ -144,7 +144,7 @@ class SSETransport:
|
||||
finally:
|
||||
read_queue.put(None)
|
||||
|
||||
def _send_message(self, client: httpx.Client, endpoint_url: str, message: SessionMessage) -> None:
|
||||
def _send_message(self, client: httpx.Client, endpoint_url: str, message: SessionMessage):
|
||||
"""Send a single message to the server.
|
||||
|
||||
Args:
|
||||
@@ -163,7 +163,7 @@ class SSETransport:
|
||||
response.raise_for_status()
|
||||
logger.debug("Client message sent successfully: %s", response.status_code)
|
||||
|
||||
def post_writer(self, client: httpx.Client, endpoint_url: str, write_queue: WriteQueue) -> None:
|
||||
def post_writer(self, client: httpx.Client, endpoint_url: str, write_queue: WriteQueue):
|
||||
"""Handle writing messages to the server.
|
||||
|
||||
Args:
|
||||
@@ -303,7 +303,7 @@ def sse_client(
|
||||
write_queue.put(None)
|
||||
|
||||
|
||||
def send_message(http_client: httpx.Client, endpoint_url: str, session_message: SessionMessage) -> None:
|
||||
def send_message(http_client: httpx.Client, endpoint_url: str, session_message: SessionMessage):
|
||||
"""
|
||||
Send a message to the server using the provided HTTP client.
|
||||
|
||||
|
Reference in New Issue
Block a user