Skip to content

Within Lex, how do you create a new line in the prompt, to add spacing in the message reply? I want to line break a prompt?

0

I have tried /n then tried \n, I also tried <br>

I want to display like this

" Does this work Yes or No? "

Instead it displays like this "Does this work Yes or No?"

  • Are you just looking to create a new line because you want to see a new line but not to add a break to speech?

  • This is for chat conversations, I was trying to separate the text in message box

2 Answers
0

It seems to depend on the Channel being used, here are some of the things that you should try: \r\n \n %0a

answered a year ago
-1

To create a new line in an Amazon Lex prompt, you should use SSML (Speech Synthesis Markup Language) tags in your response text. When configuring the response for an intent in Lex, you can include your text within SSML tags and use break tags to create pauses or line breaks.

For example, you can format your prompt like this:

<speak>
Does this work
<break time="500ms"/>
Yes or No?
</speak>

The <break> tag creates a pause that effectively serves as a line break in the conversation flow. You can adjust the time value to control the length of the pause.

You can add this SSML markup directly in the response section when configuring your intent in the Lex console. This approach allows you to format your responses with appropriate spacing and line breaks for a better user experience.
Sources
Using ssml in lex | AWS re:Post

answered a year ago

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.