3

I've tried other responses mentioned on other forums but I'm still not able to get the right result.

As of this moment, this is what the layout looks like

Any help would be much appreciated!

Pranav Menon
  • 181
  • 3
  • 10

3 Answers3

3

Add in your Watson response the HTML tag, the browser will render:

The link to go to google is: click <a  target="_blank" href="https://google.com.br">Google</a>.<br/><br/>

Add inside Watson response:

enter image description here Tested hyperlink:

enter image description here

Obs.: Check inside Try it out, this does not work, but inside your Web application, all will works fine. This is valid for other <html> tag, for example: <button>, etc

I Answer the same question here. Answer with more details and images here.

Community
  • 1
  • 1
Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53
0

replace the "quotation marks" around the link with 'apostrophe'

{
  "output": {
    "text": {
      "values": [
        "say something <a href='http://www.website.com/'>link text</a>"
      ],
      "selection_policy": "sequential"
    }
  }
}
-1

You need to pass the hyperlink through the context

Example (using python at backend) -

response['context']['link'] = "www.google.com"
conversation.message(workspace_id=workspace_id,
    message_input={'text': user_input},
    context=response['context'])

Now in your dialog

{
  "context": {},
  "output": {
    "text": {
      "values": [
        "$link"
      ],
      "selection_policy": "sequential"
    }
  }
}

So the values you pass in context are displayed prefix $

Swapnesh Khare
  • 109
  • 1
  • 10