google: updgrade OpenAILLMContext to GoogleLLMContext

This commit is contained in:
Aleix Conchillo Flaqué
2025-02-24 15:35:18 -08:00
parent 30cdd1b71a
commit 40c2452d6e
2 changed files with 5 additions and 0 deletions

View File

@@ -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.

View File

@@ -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