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.
This commit is contained in:
@@ -1142,8 +1142,9 @@ class GeminiLiveLLMService(LLMService):
|
|||||||
params = adapter.get_llm_invocation_params(self._context)
|
params = adapter.get_llm_invocation_params(self._context)
|
||||||
system_instruction = params["system_instruction"]
|
system_instruction = params["system_instruction"]
|
||||||
tools = params["tools"]
|
tools = params["tools"]
|
||||||
else:
|
if not system_instruction:
|
||||||
system_instruction = self._system_instruction_from_init
|
system_instruction = self._system_instruction_from_init
|
||||||
|
if not tools:
|
||||||
tools = adapter.from_standard_tools(self._tools_from_init)
|
tools = adapter.from_standard_tools(self._tools_from_init)
|
||||||
if system_instruction:
|
if system_instruction:
|
||||||
logger.debug(f"Setting system instruction: {system_instruction}")
|
logger.debug(f"Setting system instruction: {system_instruction}")
|
||||||
|
|||||||
Reference in New Issue
Block a user