From 191bdc733fa13bd22e13bb54559fe83978eaec60 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Mon, 27 Apr 2026 16:05:25 -0400 Subject: [PATCH] fix: conform AWSNovaSonicLLMService.get_setup_params to its protocol The service implements the NovaSonicSessionSender protocol so the session-continuation helper can target either the current or next session. The protocol declares `get_setup_params(self) -> tuple[str | None, list]`, but the implementation was unannotated and could return NotGiven in the tools position when from_standard_tools fell through to its NotGiven sentinel. Add the matching return annotation and coerce the NotGiven case to an empty list. --- src/pipecat/services/aws/nova_sonic/llm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pipecat/services/aws/nova_sonic/llm.py b/src/pipecat/services/aws/nova_sonic/llm.py index e16f288e1..71a80e444 100644 --- a/src/pipecat/services/aws/nova_sonic/llm.py +++ b/src/pipecat/services/aws/nova_sonic/llm.py @@ -1106,7 +1106,7 @@ class AWSNovaSonicLLMService(LLMService): ''' await self.send_event(event_json, stream) - def get_setup_params(self): + def get_setup_params(self) -> tuple[str | None, list]: """Return ``(system_instruction, tools)`` for the next session setup.""" if not self._context: return None, [] @@ -1115,7 +1115,9 @@ class AWSNovaSonicLLMService(LLMService): self._context, system_instruction=self._settings.system_instruction ) tools = ( - llm_params["tools"] if llm_params["tools"] else adapter.from_standard_tools(self._tools) + llm_params["tools"] + if llm_params["tools"] + else (adapter.from_standard_tools(self._tools) or []) ) return llm_params["system_instruction"], tools