dograh/api/services/pipecat/realtime/gemini_live_vertex.py
Abhishek 2381a803ad
feat: add openai realtime models (#298)
* feat: add openai realtime models

* chore: bump pipecat

* fix: resample telephony audio for openai realtime

* fix: sampling rate fix for openai realtime

* chore: clean up dead code
2026-05-16 18:05:23 +05:30

42 lines
1.3 KiB
Python

"""Dograh subclass of pipecat's Gemini Live Vertex AI LLM service.
Diamond inheritance: combines the Dograh engine-integration overrides from
:class:`DograhGeminiLiveLLMService` with the Vertex-specific tweaks from
upstream's :class:`GeminiLiveVertexLLMService` (no history config,
``NON_BLOCKING`` tools disabled, service-account credentials).
MRO::
DograhGeminiLiveVertexLLMService
-> DograhGeminiLiveLLMService
-> GeminiLiveVertexLLMService
-> GeminiLiveLLMService
-> LLMService
-> ...
"""
from api.services.pipecat.realtime.gemini_live import DograhGeminiLiveLLMService
from pipecat.services.google.gemini_live.vertex.llm import (
GeminiLiveVertexLLMService,
)
class DograhGeminiLiveVertexLLMService(
DograhGeminiLiveLLMService,
GeminiLiveVertexLLMService,
):
"""Vertex AI variant of Gemini Live with Dograh integration quirks."""
pass
# Guard against MRO regressions: a future refactor that flips inheritance
# order or breaks the diamond would silently bypass the Dograh overrides.
_mro = DograhGeminiLiveVertexLLMService.__mro__
assert _mro[1] is DograhGeminiLiveLLMService, (
f"Expected DograhGeminiLiveLLMService at MRO[1], got {_mro[1]}"
)
assert _mro[2] is GeminiLiveVertexLLMService, (
f"Expected GeminiLiveVertexLLMService at MRO[2], got {_mro[2]}"
)
del _mro