Silence krisp_audio import logs on auto-import

The two logger.error lines in krisp_instance.py fired at module-load time
whenever anything transitively imported it (e.g. pipecat.turns.user_start
pulling in krisp_viva_ip_user_turn_start_strategy), producing noisy output
for users who never asked for Krisp. Drop the log calls and raise a more
informative ImportError that names the affected classes so direct
importers still get clear guidance.
This commit is contained in:
Mark Backman
2026-04-17 16:51:00 -04:00
parent 8c8b76e9d2
commit ce9c214eec

View File

@@ -15,9 +15,11 @@ from loguru import logger
try:
import krisp_audio
except ModuleNotFoundError as e:
logger.error(f"Exception: {e}")
logger.error("In order to use the Krisp instance, you need to install krisp_audio.")
raise ImportError(f"Missing module: {e}") from e
raise ImportError(
"krisp_audio is required for Krisp audio features. "
"Install it to use KrispVivaFilter, KrispVivaVadAnalyzer, "
"KrispVivaTurn, or KrispVivaIPUserTurnStartStrategy."
) from e
# Mapping of sample rates (Hz) to Krisp SDK SamplingRate enums