Add deprecation warning around importing StartSensitivity and EndSensitivity from pipecat.services.gemini_multimodal_live.events

This commit is contained in:
Paul Kompfner
2025-10-08 15:26:19 -04:00
parent ac1582c906
commit 2921162b3b

View File

@@ -4,7 +4,14 @@
# SPDX-License-Identifier: BSD 2-Clause License # SPDX-License-Identifier: BSD 2-Clause License
# #
"""Event models and utilities for Google Gemini Multimodal Live API.""" """Event models and utilities for Google Gemini Multimodal Live API.
.. deprecated:: 0.0.90
Importing StartSensitivity and EndSensitivity from this module is deprecated.
Import them directly from google.genai.types instead.
"""
import warnings
from loguru import logger from loguru import logger
@@ -23,5 +30,12 @@ except ModuleNotFoundError as e:
# These aliases are just here for backward compatibility, since we used to # These aliases are just here for backward compatibility, since we used to
# define public-facing StartSensitivity and EndSensitivity enums in this # define public-facing StartSensitivity and EndSensitivity enums in this
# module. # module.
warnings.warn(
"Importing StartSensitivity and EndSensitivity from "
"pipecat.services.gemini_multimodal_live.events is deprecated. "
"Please import them directly from google.genai.types instead.",
DeprecationWarning,
stacklevel=2,
)
StartSensitivity = _StartSensitivity StartSensitivity = _StartSensitivity
EndSensitivity = _EndSensitivity EndSensitivity = _EndSensitivity