diff --git a/src/pipecat/audio/turn/smart_turn/local_smart_turn_v3.py b/src/pipecat/audio/turn/smart_turn/local_smart_turn_v3.py index e62131e0c..84f6b5622 100644 --- a/src/pipecat/audio/turn/smart_turn/local_smart_turn_v3.py +++ b/src/pipecat/audio/turn/smart_turn/local_smart_turn_v3.py @@ -94,10 +94,10 @@ class LocalSmartTurnAnalyzerV3(BaseSmartTurn): sample_rate: The sample rate of the audio data. suffix: Optional suffix to append to the filename (e.g., "_raw", "_padded"). """ - import wave - from datetime import datetime import os import threading + import wave + from datetime import datetime # Generate filename with current timestamp (millisecond precision) timestamp = datetime.now().strftime("%Y-%m-%d__%H:%M:%S.%f")[:-3] @@ -177,4 +177,4 @@ class LocalSmartTurnAnalyzerV3(BaseSmartTurn): return { "prediction": prediction, "probability": probability, - } \ No newline at end of file + } diff --git a/src/pipecat/utils/env.py b/src/pipecat/utils/env.py index b3467c1f4..cb66a5400 100644 --- a/src/pipecat/utils/env.py +++ b/src/pipecat/utils/env.py @@ -18,6 +18,7 @@ class InvalidEnvVarValueError(ValueError): """Raised when an environment variable value cannot be parsed.""" def __init__(self, name: str, value: str, expected: str): + """Initialize an InvalidEnvVarValueError.""" super().__init__(f"Invalid value for env var {name!r}: {value!r}. Expected {expected}.") self.name = name self.value = value @@ -35,7 +36,6 @@ def env_truthy(name: str, default: bool = False) -> bool: - Truthy: "1", "true", "yes", "y", "on" - Falsy: "0", "false", "no", "n", "off", "" """ - raw = os.getenv(name) if raw is None: return default @@ -49,6 +49,5 @@ def env_truthy(name: str, default: bool = False) -> bool: raise InvalidEnvVarValueError( name=name, value=raw, - expected='true or false', + expected="true or false", ) -