Improve 20e example to ask the bot to give a recap when loading a previous conversation from disk

This commit is contained in:
Paul Kompfner
2026-01-16 22:26:31 -05:00
parent 6fa797c8e4
commit c89083e72e

View File

@@ -114,6 +114,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()