mirror of
https://github.com/HumanAIGC-Engineering/gradio-webrtc.git
synced 2026-02-05 18:09:23 +08:00
Enforce modern typing (#258)
* Allow UP * Upgrade typing * test smolagents * Change to contextlib --------- Co-authored-by: Marcus Valtonen Örnhag <marcus.valtonen.ornhag@ericsson.com>
This commit is contained in:
committed by
GitHub
parent
a07e9439b6
commit
f70b27bd41
@@ -1,11 +1,10 @@
|
||||
import logging
|
||||
from collections.abc import Callable
|
||||
from contextlib import AbstractAsyncContextManager
|
||||
from pathlib import Path
|
||||
from typing import (
|
||||
Any,
|
||||
AsyncContextManager,
|
||||
Callable,
|
||||
Literal,
|
||||
Optional,
|
||||
TypedDict,
|
||||
cast,
|
||||
)
|
||||
@@ -29,8 +28,8 @@ curr_dir = Path(__file__).parent
|
||||
|
||||
|
||||
class Body(BaseModel):
|
||||
sdp: Optional[str] = None
|
||||
candidate: Optional[dict[str, Any]] = None
|
||||
sdp: str | None = None
|
||||
candidate: dict[str, Any] | None = None
|
||||
type: str
|
||||
webrtc_id: str
|
||||
|
||||
@@ -253,7 +252,7 @@ class Stream(WebRTCConnectionMixin):
|
||||
return wrapper
|
||||
|
||||
def _inject_startup_message(
|
||||
self, lifespan: Callable[[FastAPI], AsyncContextManager] | None = None
|
||||
self, lifespan: Callable[[FastAPI], AbstractAsyncContextManager] | None = None
|
||||
):
|
||||
"""
|
||||
Create a FastAPI lifespan context manager to print startup messages and check environment.
|
||||
|
||||
Reference in New Issue
Block a user