AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

How to put link of a picture in response
 
 

Can someone tell me how to add a link to a picture into a response? I would like my chatbot to respond with this link “https://scontent-a-atl.xx.fbcdn.net/hphotos-xaf1/v/t1.0-9/10678857_10152919440091840_592766477037721252_n.jpg?oh=f7b7ee91f9bdd09366af19ce32d35267&oe=54DC9F05” for the human to click on in response to when the human makes a mistake with “your” and “you’re”. What is the AIML code for that?

 

 
  [ # 1 ]

If your AIML chatbot is web-based, you can simply use the HTML <img> tag, like so:

<category>
  <
pattern>SHOW ME A PICTURE</pattern>
  <
template>
    <
img src="https://scontent-a-atl.xx.fbcdn.net/hphotos-xaf1/v/t1.0-9/10678857_10152919440091840_592766477037721252_n.jpg?oh=f7b7ee91f9bdd09366af19ce32d35267&oe=54DC9F05">
  </
template>
</
category

Of course, if your chatbot interface uses Flash, or if it’s a stand-alone program, then the technique will most likely be different. For a Flash interface, it’s best to ask Steve how he gets his chatbot, Mitsuku, to display images, and for stand-alone programs, I couldn’t give you a proper answer without a lot more information.

(funny image, BTW)

 

 
  [ # 2 ]

For flash, you would need some inidication at the start of the response that the bot had received an image (something like XIMAGE) and then in your flash detect replies that start with XIMAGE. You can then use a getUrl command in flash to display the image.

I haven’t got into too much detail as I think you use a Pandorabot if memory serves me correctly.

 

 
  [ # 3 ]

Thanks guys! I will use your suggestion Dave, it’s just a pandorabots chat bot with no flash or anything fancy like that.

 

 
  [ # 4 ]

If you’re going to be using only a few images like that (say, less than 100 or so), and they all have long URLs like the one in your example, I would like to suggest using bit.ly or tinyurl to shorten the URL for the images, so that it’s easier to write and maintain the code. Here’s an example, using the URL example, above, via bit.ly:

http://bit.ly/1vu5Ko5

As you can see, the URL is a LOT shorter, and thus, easier to insert into an AIML category without it looking messy. smile

BTW, both bit.ly and tinyurl work for page links, but bit.ly is more “image friendly”. wink

 

 
  [ # 5 ]

Thank you. I’ll try that too!

 

 
  [ # 6 ]

Hello Dave,

I’m trying to create a small chatterbot to be presented in a work of univseridade and because the AIML not be so widespread in Brazil I have a little trouble. I utilisando the Program it based on php and my chatterbot will answer questions to help users lay an ATM.
The first difficulty I had was to put images on a response. Using html <img > within the tremplate simply nothing is displayed.

Dave Morton - Nov 20, 2014:

If your AIML chatbot is web-based, you can simply use the HTML <img> tag, like so:

<category>
  <
pattern>SHOW ME A PICTURE</pattern>
  <
template>
    <
img src="https://scontent-a-atl.xx.fbcdn.net/hphotos-xaf1/v/t1.0-9/10678857_10152919440091840_592766477037721252_n.jpg?oh=f7b7ee91f9bdd09366af19ce32d35267&oe=54DC9F05">
  </
template>
</
category

Of course, if your chatbot interface uses Flash, or if it’s a stand-alone program, then the technique will most likely be different. For a Flash interface, it’s best to ask Steve how he gets his chatbot, Mitsuku, to display images, and for stand-alone programs, I couldn’t give you a proper answer without a lot more information.

(funny image, BTW)

 

 
  [ # 7 ]

Try this:

<category>
    <
pattern>SHOW ME MITSUKU</pattern>
    <
template><img src="http://www.square-bear.co.uk/mitsuku/mitsuku_big2.jpg"><br/>Here you go.</img></template>
</
category

The closing </img> tag was missing in the example you posted. Also, the original image is no longer there if you were copy/pasting.

 

 
  [ # 8 ]

Hello,

Anyone can help me in this? I am trying to use AIML to create a simple bot that allows a user to say Hi only and then the bot replies by asking him questions with several answers that he has to choose one of them as a reply. Then the chat will end by opening a new link or webpage.

Thanks a lot!

 

 
  [ # 9 ]

Gd evening sir, I am making a chat bot ..but. I want to make it more interactive and how to provide links of photos if these are in your computer.

 

 
  [ # 10 ]

If the photos are on your local hard drive and not on the internet, I don’t see how others will be able to see them.

 

 
  [ # 11 ]

like your Mitsuku I want my chatbot interactive like that.
And can We, add button in our program.

 

 
  [ # 12 ]

how our bot ask from its users automatically.

 

 
  [ # 13 ]

I think you will need to host your own chatbot and control the UI layout if you want it to be like Mitsuku.  You cannot run it on your local PC. 

Also, I tried to implement a image link from the Pandorabots playground and I could not get it to work either.  Years ago this was possible when they hosted a custom html page for free that you could customize.

If anyone has published an actual chatbot hosted on the Pandorabots playground that demonstrates how an image can be shown then please post the chatbot name.

I believe you will have to have a web server that hosts your site and then calls the pandorabot api.  Whatever webpage you end up creating to show the chat messages should not limit your ability to show linked images.

If anyone has used a full service hosting site that allowed them to host custom web pages and custom code for their chatbot then please post a suggestion and possibly a link to chat with the chatbot.

 

 
  [ # 14 ]

Hi! I’m trying to send an image with my pandorabot to my phone (to text).
I receive the text but not the image link!

I use Twilio(to have a number for my bot) and web server!

I tried that:

<category>
<
pattern>SHOW ME A APPLE</pattern>
<
template><img width="250px" src="https://www.organicfacts.net/wp-content/uploads/2013/05/Apple4.jpg"><br/></img></template>
</
category

But on the pandorat dashboard i have the image!

 

 
  [ # 15 ]

Hi and welcome to chatbots.org, Fabiola! smile

Well, there is a little bit of a syntax error with your HTML to display the image, but that might not necessarily be the problem. I’ll place some AIML at the end of my post to have you try that doesn’t have the broken HTML in it, but it may have a problem of a different kind. Please tell me, how do you use your chatbot on your phone? Do you use a web browser, or an app of some sort. If a browser, please tell us which one, so that we can do some testing. If it’s an app, please tell us which one, and what type of phone (iPhone, Android, Windows phone, whatever), again, so testing could be done.

In the meantime, here’s that promised improved code:

<category>
    <
pattern>SHOW ME APPLE</pattern><!-- covers "a apple""an apple"etc. -->
    <
template>
        <
img src="https://www.organicfacts.net/wp-content/uploads/2013/05/Apple4.jpg" width="250px" />
    </
template>
</
category

If this improved HTML/AIML code doesn’t work, then those questions I’ve asked above become VERY important.

 

 1 2 > 
1 of 2
 
  login or register to react