From 84ba628dfb2bd155a911f9ea68ed9c52aeff0c8d Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Wed, 5 Nov 2025 11:40:36 -0500 Subject: [PATCH] Fix a bug in `GeminiLiveLLMService` where if only *one* of tools or system instruction was provided in the context, the other wouldn't fall back to using the value provided in the constructor. Not adding this fix to the CHANGELOG since `GeminiLiveLLMService`'s ability to properly handle context-provided tools and system instruction hasn't been published yet. --- src/pipecat/services/google/gemini_live/llm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pipecat/services/google/gemini_live/llm.py b/src/pipecat/services/google/gemini_live/llm.py index c7e4827df..317ed034d 100644 --- a/src/pipecat/services/google/gemini_live/llm.py +++ b/src/pipecat/services/google/gemini_live/llm.py @@ -1142,8 +1142,9 @@ class GeminiLiveLLMService(LLMService): params = adapter.get_llm_invocation_params(self._context) system_instruction = params["system_instruction"] tools = params["tools"] - else: + if not system_instruction: system_instruction = self._system_instruction_from_init + if not tools: tools = adapter.from_standard_tools(self._tools_from_init) if system_instruction: logger.debug(f"Setting system instruction: {system_instruction}")