Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

button link not showing when returing a card #47

Open
fspegni opened this issue Apr 20, 2022 · 0 comments
Open

button link not showing when returing a card #47

fspegni opened this issue Apr 20, 2022 · 0 comments

Comments

@fspegni
Copy link

fspegni commented Apr 20, 2022

Hello,

I'm having a hard time trying to return a conversational prompt with a card containing a link. I tried reading the documentation and followed one of your tests, but I can't get it working. This is an excerpt of my code:

    conv.add(new Card({
       title: "this is title",
       image: new Image({
         url: OPEN_STREET_MAP_LOGO,
         alt: 'Open Street Map logo',
       }),
       button: new Link({
         name: 'Learn more',
         open: {
           url: 'https://www.google.com/about/',
         },
       }),
    }));

This is the JSON returned by my webhook (copied from the simulator):

{
  "responseJson": {
    "session": { ... },
    "prompt": {
      "override": false,
      "content": {
        "card": {
          "title": "this is title",
          "image": {
            "alt": "Google app logo",
            "height": 0,
            "url": "https://wiki.openstreetmap.org/w/images/thumb/7/79/Public-images-osm_logo.svg/240px-Public-images-osm_logo.svg.png",
            "width": 0
          },
          "button": {
            "name": "Learn more",
            "open": {
              "url": "https://www.google.com/about/"
            }
          }
        }
      },
      "firstSimple": {
        "speech": "Here is a map for your project",
        "text": ""
      }
    }
  }
}

Below you can find the rendered card, without button. Am I doing something wrong here?

bug_conversational_agent

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

No branches or pull requests

1 participant