SmallWebRTCConnection: complain if av package not found

This commit is contained in:
Aleix Conchillo Flaqué
2025-05-12 10:07:06 -07:00
parent 175f352ea7
commit 8171fec925

View File

@@ -9,7 +9,6 @@ import json
import time import time
from typing import Any, List, Literal, Optional, Union from typing import Any, List, Literal, Optional, Union
from av.frame import Frame
from loguru import logger from loguru import logger
from pydantic import BaseModel, TypeAdapter from pydantic import BaseModel, TypeAdapter
@@ -24,6 +23,7 @@ try:
RTCSessionDescription, RTCSessionDescription,
) )
from aiortc.rtcrtpreceiver import RemoteStreamTrack from aiortc.rtcrtpreceiver import RemoteStreamTrack
from av.frame import Frame
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.error(f"Exception: {e}") logger.error(f"Exception: {e}")
logger.error("In order to use the SmallWebRTC, you need to `pip install pipecat-ai[webrtc]`.") logger.error("In order to use the SmallWebRTC, you need to `pip install pipecat-ai[webrtc]`.")