fix: handle NotGiven from from_standard_tools in Nova Sonic connect

Same pattern as the earlier get_setup_params fix: when context tools
are absent, the fallback `adapter.from_standard_tools(self._tools)`
can return the NotGiven sentinel, and `_send_prompt_start_event`
expects a list. Coerce via `or []` so the NotGiven case becomes an
empty list.
This commit is contained in:
Paul Kompfner
2026-04-27 16:53:21 -04:00
parent 53ce57b7fa
commit d23bdaaacd

View File

@@ -654,7 +654,7 @@ class AWSNovaSonicLLMService(LLMService):
tools = (
llm_connection_params["tools"]
if llm_connection_params["tools"]
else adapter.from_standard_tools(self._tools)
else (adapter.from_standard_tools(self._tools) or [])
)
logger.debug(f"Using tools: {tools}")
await self._send_prompt_start_event(tools)