Skip to content

Instead of user trigger first, i need the nova sonic model trigger first and say welcome address to user, after the start conversation is clicked.

0

using nova sonic in local machine, (refer from the link is "https://github.com/aws-samples/amazon-nova-samples/tree/main/speech-to-speech/workshops"). While the running program, after click the "start conversation" button, user wants to trigger first like say that "hi", "hello", then only the nova sonic is react and reply to user. Instead of this, i need to after the click the "start conversation" button, the nova sonic model is react and invite the welcome address?

2 Answers
1
Accepted Answer

The workaround is to send a silent (pre-recorded) audio clip to Sonic to initiate the conversation.

answered a year ago

  • Thank you for your reply. Yes, that's what I ended up doing. My audio clip wasn't silent, but I did a single word. It's a bit rubbish though, because it introduces an unnecessary latency before Nova Sonic starts responding.

  • Could you provide a bit more exact implementation? I have put a bit of silent audio, but it doesn't work unfortunately

  • Silent audio does not work, you have to actually put some content in. I just recorded the word "talk" and played that. It only took a few buffers and I trimmed the start/end of the audio to minimise it. It is by far an ideal solution.

    If I was in charge of the Bedrock Runtime / Nova roadmap, I would have an option to avoid having to do this....

0

To modify the behavior of Amazon Nova Sonic so that it initiates the conversation with a welcome address after the "Start Conversation" button is clicked, you'll need to adjust the event flow in your application. Here's how you can achieve this:

  1. After the "Start Conversation" button is clicked, instead of waiting for user input, immediately send a system prompt event to Nova Sonic. This prompt should instruct the model to start with a welcome message.

  2. In your system prompt, include instructions for the model to begin the conversation. For example:

    "You are a friendly assistant. Begin the conversation by welcoming the user with a brief greeting. Then, ask how you can help them today."

  3. After sending the system prompt, you should immediately send a content start event followed by an empty user input event. This simulates the user's turn in the conversation without actually requiring user input.

  4. Nova Sonic will then respond with its welcome message, initiating the conversation.

  5. After this initial exchange, the normal back-and-forth conversation can proceed as usual.

Remember that Nova Sonic uses an event-driven architecture with a bidirectional stream API. You'll need to ensure that you're sending the correct sequence of events to trigger this behavior:

  1. Send the sessionStart event
  2. Send the promptStart event
  3. Send the contentStart event for the system prompt
  4. Send the textInput event with your system instructions
  5. Send the contentEnd event for the system prompt
  6. Send a contentStart event for user input
  7. Immediately send a contentEnd event for user input (simulating an empty user turn)

By following this sequence, you can make Nova Sonic initiate the conversation with a welcome message as soon as the "Start Conversation" button is clicked, without waiting for the user to speak first.
Sources
Handling input events with the bidirectional API - Amazon Nova
System prompt authoring guidelines and examples - Amazon Nova
Using the Amazon Nova Sonic Speech-to-Speech model - Amazon Nova

answered a year ago

EXPERT

reviewed a year ago

  • Thanks Oleksii Bebych(https://repost.aws/community/users/USyYP5VPAQSSy-rWgsNiZjCw), really awesome, one question regrading this issue, can i changes the code in either python or js or both. If yes means, then which python i need to modify the order, it will be either "s2s_events.py" or "s2s_session_manager.py"?

    Code link --> "https://github.com/aws-samples/amazon-nova-samples/tree/main/speech-to-speech/workshops"

  • The automatically generated suggestion doesn't work. The empty contentStart + contentEnd suggested in steps 6 and 7 causes the error: "Cannot end content [UUID] as no content data was received".

    Does anybody know how to make the Nova Sonic assistant speak first at the start of a conversation, rather than waiting for the user to speak first?

  • I spent a day trying every possible way to get this working. It doesn’t work.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.