Parse config.yaml into typed AppConfig dataclass

- ServerConfig, VideoConfig, ModelConfig, DeadBugConfig,
  AudioConfig, LoggingConfig as nested dataclasses
- Consumers use config.server.host, config.model.resolved_path etc.
- env var overrides preserved via _apply_env_overrides()
This commit is contained in:
2026-06-10 10:23:51 +08:00
parent c8fd057129
commit f9384f7bc1
7 changed files with 116 additions and 109 deletions
+4 -3
View File
@@ -7,7 +7,7 @@ import websockets
from loguru import logger
from app.webrtc.peer_session import PeerSession
from configs.load import WS_HOST, WS_MAX_SIZE, WS_PORT
from configs.load import config
async def handle_client(websocket):
@@ -21,6 +21,7 @@ async def handle_client(websocket):
async def main():
logger.info(f"WebRTC signaling server: ws://{WS_HOST}:{WS_PORT}")
async with websockets.serve(handle_client, WS_HOST, WS_PORT, max_size=WS_MAX_SIZE):
cfg = config.server
logger.info(f"WebRTC signaling server: ws://{cfg.host}:{cfg.port}")
async with websockets.serve(handle_client, cfg.host, cfg.port, max_size=cfg.max_ws_size):
await asyncio.Future()