From 40c2452d6e5e160a08e022ac9ba3d2d487863583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 24 Feb 2025 15:35:18 -0800 Subject: [PATCH] google: updgrade OpenAILLMContext to GoogleLLMContext --- CHANGELOG.md | 3 +++ src/pipecat/services/google/google.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 299ead7b0..3a1651808 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,9 @@ stt = DeepgramSTTService(..., live_options=LiveOptions(model="nova-2-general")) ### Fixed +- Fixed an issue that was not allowing to pass an `OpenAILLMContext` to create + `GoogleLLMService`'s context aggregators. + - Fixed a `ElevenLabsTTSService`, `FishAudioTTSService`, `LMNTTTSService` and `PlayHTTTSService` issue that was resulting in audio requested before an interruption being played after an interruption. diff --git a/src/pipecat/services/google/google.py b/src/pipecat/services/google/google.py index 58042ab81..1dafc92bc 100644 --- a/src/pipecat/services/google/google.py +++ b/src/pipecat/services/google/google.py @@ -1176,6 +1176,8 @@ class GoogleLLMService(LLMService): def create_context_aggregator( context: OpenAILLMContext, *, assistant_expect_stripped_words: bool = True ) -> GoogleContextAggregatorPair: + if isinstance(context, OpenAILLMContext): + context = GoogleLLMContext.upgrade_to_google(context) user = GoogleUserContextAggregator(context) assistant = GoogleAssistantContextAggregator( context, expect_stripped_words=assistant_expect_stripped_words