Giter Club home page Giter Club logo

Comments (7)

atoa avatar atoa commented on May 14, 2024

Hello

this is despite my Lambda function (written in C#) having the \n line break in the output method. How can I get the bot to display each result on its own line, if that's possible?

This is due to the bot response content being ultimately incorporated as HTML. In HTML, the \n character is not rendered as a line break. You normally use <br> tags for line breaks in HTML.

However, the chatbot UI doesn't currently support HTML tags in messages. We are tracking a feature request to support rendering basic HTML tags or markdown in the bot responses. See item 3 in: #7. This is a feature we are considering to implement in the future.

Possible alternatives include:

  1. Break up the list into a dialog (e.g. [bot:] "You have 3 active events. Do you want details about these events?" > [user:] "yes" > [bot:] "The latest event, ID 32, is .... Do you want to change this event or hear about the next one?'" ). This is also useful if you want to avoid long responses when using speech. See Building Better Bots for some dialog design considerations
  2. Use Response Cards to visually organize the response data. You could render items as buttons or have a response card with multiple Generic Attachments
  3. Modify the Message.vue file to implement a custom rendering logic

I hope this helps

-- Oliver

from aws-lex-web-ui.

baendron avatar baendron commented on May 14, 2024

Hi Oliver, thanks for the prompt response. You said break up the list into a dialog. Would that be a ConfirmIntent? As far as I know, LexResponse can only be one of the following:

Delegate
ElicitIntent
ElicitSlot
ConfirmIntent
Close

Also, can you explain how to attach the ResponseCard to the message? Mine doesn't seem to show at all:
lex 4

UPDATE:
I've managed to modify the Message.vue file so that the bot displays the HTML tags properly. The only issue now is that when I click a link in the message, the index.html that the iframe references is updated instead of the parent page. Can you provide any help to help me fix this?

Before I click the link:
lex 6

After I click the link:
lex 5

from aws-lex-web-ui.

baendron avatar baendron commented on May 14, 2024

UPDATE:
Sorry to keep posting updates but I managed to fix the issue by changing the target of the link.

<br><a href=\"{link}\" target=\"_top\">Event: {evt.ID} - Status: {evt.Status}</a>

Thanks a lot for your help Oliver!

from aws-lex-web-ui.

stevejwebb avatar stevejwebb commented on May 14, 2024

Hi is this still open? Where do I find the Message.vue file?
Thanks.

from aws-lex-web-ui.

bobpskier avatar bobpskier commented on May 14, 2024

from aws-lex-web-ui.

pr4shantS0naw4n3 avatar pr4shantS0naw4n3 commented on May 14, 2024

Hi Oliver, thanks for the prompt response. You said break up the list into a dialog. Would that be a ConfirmIntent? As far as I know, LexResponse can only be one of the following:

Delegate
ElicitIntent
ElicitSlot
ConfirmIntent
Close

Also, can you explain how to attach the ResponseCard to the message? Mine doesn't seem to show at all:
lex 4

UPDATE:
I've managed to modify the Message.vue file so that the bot displays the HTML tags properly. The only issue now is that when I click a link in the message, the index.html that the iframe references is updated instead of the parent page. Can you provide any help to help me fix this?

Before I click the link:
lex 6

After I click the link:
lex 5

How did you format your output,each on new line????
please show the sample code

from aws-lex-web-ui.

ShijunL avatar ShijunL commented on May 14, 2024

\n and br both not working, please, anybody give a fix? thanks.

from aws-lex-web-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.