Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulator Directline Html Tags #1245

Open
SemenKrupin opened this issue Dec 23, 2022 · 3 comments
Open

Emulator Directline Html Tags #1245

SemenKrupin opened this issue Dec 23, 2022 · 3 comments

Comments

@SemenKrupin
Copy link

SemenKrupin commented Dec 23, 2022

Hello! Using the emulator in Directline, how can you pass not just text, but text in Html format so that Html elements are drawn in the chat window?
image

I looked at the documentation, but did not understand whether it is possible to operate with such Html components as Button, Div, Table, etc.

@ericzon
Copy link
Collaborator

ericzon commented Dec 23, 2022

Hello @SemenKrupin , we use a webchat client developed by Microsoft. This client can render plain text, adaptive cards and can also show some markdown features. Please, take a look to these links.

@SemenKrupin
Copy link
Author

SemenKrupin commented Dec 23, 2022

Hello @SemenKrupin , we use a webchat client developed by Microsoft. This client can render plain text, adaptive cards and can also show some markdown features. Please, take a look to these links.

Thank you very much for the information.
Tell me, please, how can I apply the Adaptive Card schema with NLP.js?
In the documentation, it is indicated that you need to place an object in the response

{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "version": "1.0",
  body: [
    {
      "type": "container",
      "items": [
...

And how to form a response and send it to NLP.js?

@aigloss
Copy link
Collaborator

aigloss commented Jan 25, 2023

Hi @SemenKrupin ,

bot orchestration is able to send cards using the 'card' command. You can check its executeAction method to figure out how this card thing works. Note that, in the bot's use case, it's loading cards from files like:


{
        "name": "cardOptionsTemplate",
        "type": "message",
        "attachments": [
                {
                        "contentType": "application/vnd.microsoft.card.adaptive",
                        "content": {
                                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                                "type": "AdaptiveCard",
                                "id": "booleanAnswer",
                                "version": "1.0",
                                "speak": "{{ cardMsg }}",
                                "body": [
                                        {
                                                "type": "TextBlock",
                                                "text": "{{ cardMsg }}",
                                                "size": "Medium",
                                                "wrap": true
                                        }
                                ],
                                "actions": []
                        }
                }
        ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants