Hello, how do i display an image using IBM Watson conversation that is linked to facebook messenger using IBM Watson? - ibm-watson

I have created a bot using IBM Watson Conversation and that bot only is able chat with normal text. How do i program the bot to chat with images as well? How do i embed an image into the chatbots' response?

Within the dialog tool itself you will not be able to view any other type of media other than text. The output in the test panel will simply show the output from the node.
When deployed to an application such as a web application the output node would look something like this containing HTML markup:
{
"output": {
"text": {
"values": [
"Hello world Click here"
],
"selection_policy": "sequential"
}
}
}
In this case to display an image you would simply replace the link tag with that of an HTML image etc.
An example starter kit can be found here https://github.com/watson-developer-cloud/conversation-simple
You will need an orchestration layer to handle the encoding to the desired platform format e.g FB messenger requires an object to be passed such as
"buttons":[
{
"type":"web_url",
"url":"https://petersfancyapparel.com/criteria_selector",
"title":"Select Criteria",
"webview_height_ratio": "full",
"messenger_extensions": true,
"fallback_url": "https://petersfancyapparel.com/fallback"
}
]
An example orchestration layer such as Botmaster can be used alongside its extension fulfill that will allow you to create these objects and in the Watson dialog simply just add custom XML tags. E.g www.google.com this will then be passed to the orchestration layer which will send the relevant object. A code example using this method can be found here with some other Facebook actions.

Related

Salesforce - Docusign Preview button on the record page

We got a DOCUSIGN button to generate a PDF document and send it to the clients for the e-signature but we need the one-click button to preview the document without having to go through all the steps (Selecting template -> selecting recipients --> then clicking on preview button). Really appreciate it if someone could provide guidance here.
With DAL/Apex toolkit, there is no API function allowing to preview a document inside a template. However if an envelope was already sent in draft state, built based on this template, you can preview the envelope with the API function "getSenderViewUrl".
If you're interested, please refer to the documentation: https://developers.docusign.com/docs/salesforce/apex-toolkit-reference/envelopeservice.html

How to use relative links in Bot Framework Webchat messages?

I have a bot that returns relative links to other pages in some of the plain text messages but they don't open.
If I give the full URL it opens in a new window which isn't ideal.
await context.sendActivity({
type: ActivityTypes.Message,
text: 'To know more about our team please click [here](/about/team)'
});
"To know more about our website please click here"
where here is the link as in the example below
Example
here
BotFramework-WebChat v4.13.0
botbuilder-js v4.13.1
The site with the bot is built with react and react-router.

Alexa Skill Video Api Python

I'm trying to setup a video skill for alexa, however I don't know how to play a video using the video api.
I've tried searching "alexa skill python video api" but I just get links to alexa skills kit. I've also tried reading the python sdk documentation but that didn't help. It seems like you have to send a directive or something.
Currently I have
class PlayHandler(AbstractRequestHandler):
def can_handle(self, handler_input):
return is_intent_name("PlayVidIntent")(handler_input)
def handle(self, handler_input):
speech_text = "Playing video"
# Get the video url
handler_input.response_builder.speak(speech_text).set_card(SimpleCard("Video started", speech_text)).set_should_end_session(True)
return handler_input.response_builder.response
Note: When I checked the documentation it said you had to have the video url so just assume the video url is in a variable called video_url.
More details:
Custom Skill(No video app template or Interaction model template for video skill)
Python 3.4(For server) and Python 3.5(For testing)
You will need to import modules from ask_sdk_model.interfaces.videoapp
From there you will create a LaunchDirective and create VideoItem object to be passed as the video_item argument. The VideoItem object has 2 arguments(that are optional according to the SDK), source which is a string of the URL and a metadata argument which is created with Metadata(title="Title", subtitle="Subtitle"). Finally use response_builder.add_directive to add the directive to the response.

Can I add a horizontal navigation panel in the chatbot

My chatbot returns text from search engines results on the chatbot screen with the link in the form of a list.
I want to add a horizontal navigation button suc that at once only 1 text result is shown for a query and the next result can be seen by clicking the next botton which will slide over the current result.
Can this be achieved via conversation>
Conversation is one REST API endpoint, so you can calling the Watson conversation service, and built your application with custom code.
Take a look in this project: conversation-simple. One example using Watson Conversation with Node.js (Back-end). You can simple download this project and make your custom design (like buttons) in the front-end or add more business roles in the back-end. Or, you can add your HTML custom code in the conversation and will render for you.
But, like I said, you need to build one custom code to added this painel in the Front-end (HTML, CSS, Javascript). I recommend take a look jQuery, bootstrap, or search templates.
See the API Reference for using Watson Conversation.
See the Official documentation for using this API.

how to implement link preview in angularjs

is there any directive in angularjs to implement the link preview in angularjs. I need to show the link preview while sharing a link in my web site similar to google plus.
There is some directive https://github.com/LeonardoCardoso/Link-Preview. But it uses php. I need without php.
If you are using Angular with material design you can use the following:
https://github.com/angular-material-extensions/link-preview
Else you can always do it manually using: Free link preview service
http://linkpreview.net is a Free REST API service which takes any URL as input and sends back JSON response with title, description and thumbnail.
All you need to do is send a request to their API with the URL for which link preview has to be generated.
Here’s an example request (GET)
http://api.linkpreview.net/?key=123456&q=https://www.google.com
Response:
{
"title": "Google",
"description": "Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.",
"image": "http://www.google.com/images/branding/googlelogo/1x/googlelogo_white_background_color_272x92dp.png",
"url": "https://www.google.com/"
}
You can parse the response and style it.

Resources