Merge pull request #3486 from pipecat-ai/pk/fix-nova-sonic-reset-conversation

Fix `AWSNovaSonicLLMService.reset_conversation()`
This commit is contained in:
kompfner
2026-01-20 10:07:38 -05:00
committed by GitHub
3 changed files with 43 additions and 6 deletions

View File

@@ -113,6 +113,14 @@ async def load_conversation(params: FunctionCallParams):
# "content": f"{AWSNovaSonicLLMService.AWAIT_TRIGGER_ASSISTANT_RESPONSE_INSTRUCTION}",
# }
# )
# If the last message isn't from the user, add a message asking for a recap
if messages and messages[-1].get("role") != "user":
messages.append(
{
"role": "user",
"content": "Can you catch me up on what we were talking about?",
}
)
params.context.set_messages(messages)
await params.llm.reset_conversation()
# await params.llm.trigger_assistant_response()