问题
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!
回答1:
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:
Tested hyperlink:
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.
回答2:
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"
}
}
}
回答3:
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 $
来源:https://stackoverflow.com/questions/43622965/ibm-watson-how-do-i-add-a-hyperlink-to-watson-responses