Friday, August 12, 2016

Annoucing Bot Libre for iOS 2.0

The Bot Libre iOS app has been updated with a large amount of new features.

The Bot Libre iOS app allows you to create, train and share your own chat bot from your iPhone, iPod or iPad. The chat bots have artificial intelligence and are capable of learning through conversation. You can create your own bot, or chat with other peoples bots. There are thousands of bots on Bot Libre to talk to.

Bot Libre for iOS 2.0 now includes:

  • Avatar library to choose your bot's avatar from a large selection 3D and video animated avatars.
  • Avatar editor to create your own avatar.
  • Training and chat logs
  • New learning options
  • Forums - Create your own forum to share with your friends, colleagues, or customers.
  • Rate and vote up/down content
  • Domains - Create your own personal or business space to host your chat channels, forums, and bots.

When you connect to Bot Libre, you can now choose to browse or create bots, forums, or domains.

Browse

Browse lets you search content by category, tag or filters, and order the results by several different options. 

Bot Admin

Several new bot admin options have been added.

  • Users - Control who can access your bot, and who can administer it.
  • Avatar - Select and edit the avatar used by your bot.
  • Voice - Choose and configure the voice, and language used by your bot.
  • Training/Chat logs - Set your bot's greeting phrases, and default phrases to use when it does not know any response. Train your bot with question/answer pairs.
  • Learning - Configure how your bot learns, and who is learns from.

    

Avatars

Browse a large selection of 3D and video animated avatars to use with your bot. Or use the avatar editor to create your own avatar by uploading your own images or video.

   

Forums

You can now browse or create your own forums. You can ask questions, and find answers on the Bot Libre forums, browse other user's forums, or create your own forums. You can create public or private forums, and can control who can access your forum.

   

Domains

Create your own personal or business space to host your chat channels, forums, and bots.

The Bot Libre iOS app accesses the same bots, forums, and servers as the Bot Libre website. You can access the bots you create from the app on the web. Bot Libre also provides a free open source iOS SDK, and web API that lets you build your own iOS mobile app.

Paid commercial hosting is also available through Bot Libre for Business.

Friday, June 24, 2016

Connect your Bot to the World - XML, JSON, Web Services, HTML Scraping, Twitter, Facebook, Telegram, Email

Bot Libre now supports integrating with XML and JSON web services, HTML scraping, and access to Twitter, Facebook, Telegram, email, and other services. From our scripting languages Self, and AIML you can now access any web service that returns XML or JSON data. You can also scrape information from HTML web pages, and send emails, tweets, Facebook posts, Telegram posts, and more.

Web Services

A web service is an Internet service that provides information on the web. There are countless APIs available on the web that provide every type of service imaginable, such as Google Maps, Twitter, Twilio SMS, and eBay. There also many Internet directories to help you find and use web services such as ProgrammableWeb.

Bot Libre provides web service support through its Self scripting language, and through the AIML scripting language. Bot Libre also provides a script library of common scripts to access many useful web services.

XML Web Services

XML is the parent markup language to HTML. XML defines a text based data format consisting of the data's attributes, elements, and text data. To call an XML webservice you use a web URL with either a GET request, or a POST request.

Bot Libre supports both GET and POST request with Self, and supports GET requests with AIML.

XML GET Example

This example uses the GeoNames web service from GeoNames.org. Geonames can return place names and other geographic information, given a postal code, or other geographic information.

You can apply the same pattern to access many other XML web services.

URL

XML Result

Self Example

You can access web services from Self using a Template object in a response, or from a script. The Http class is used calling the requestXML method and passing the URL, and an optional XPath expression that extract the desired data from the XML document.

XPath is a standard navigation query syntax to access or extract data from an XML document. If an XPath is not given, the call will automatically convert the XML data to a Self object. You can access the object's data using the standard JavaScript dot notation. It is much more efficient to use an XPath, so the entire XML document does not need to be converted and persisted as a Self object.

This example is also available in our script library here

AIML Example

You can access a web service from AIML using the SRAIX tag. SRAIX is an AIML tag used to call other services, or other bots. SRAIX has several attributes, the service must be set to XML to access an XML service, and the URL is given as the SRAIX body. An XPath expression must be provided to the call to extract the desired text data from the XML document.

This example is also available in our script library here

XML POST Example

An XML POST request sends, and receives XML data. Many web services use POST requests so the application can provide data to the call.

This example will actually call the Bot Libre web API using a POST request. This is somewhat unusual, as the bot is already on Bot Libre, but this lets one bot talk to another bot. Be careful doing this, as you do not want bots to get into loops or cycles. You can use this same pattern to call any other web service that takes and returns XML data, even call bots on other servers or APIs. Bot Libre also provides the sraix AIML tag and the request() Self API to allow bots to talk to other bots on Bot Libre or other services such as PandoraBots, and PersonalityForge.

Self Example

This example uses a Self state to forward a question to Brain Bot when the user says "ask Brain Bot".

This example is also available in our script library here

JSON Web Services

JSON is the standard text base object format for JavaScript. JSON can be used to convert any JavaScript object to text, and included attributes, nested objects, and arrays. To call a JSON webservice you use a web URL with either a GET request, or a POST request.

Bot Libre supports both GET and POST request with Self, and supports GET requests with AIML.

JSON GET Example

This example uses the GeoNames web service from GeoNames.org. Geonames can return place names and other geographic information, given a postal code, or other geographic information.

You can apply the same pattern to access many other JSON web services.

URL

JSON Result

Self Example

You can access web services from Self using a Template object in a response, or from a script. The Http class is used calling the requestJSON method and passing the URL, and an optional attribute that extract the desired data from the JSON document.

This example is also available in our script library here

AIML Example

You can access a web service from AIML using the SRAIX tag. SRAIX is an AIML tag used to call other services, or other bots. SRAIX has several attributes, the service must be set to JSON to access a JSON service, and the URL is given as the SRAIX body. A object attribute must be provided to the call to extract the desired text data from the JSON document.

Only basic JSON web services can be called with AIML, as AIML is texted based, not object based. Only direct attributes can be accessed. Since our GeoNames examples returns complex data, an AIML example is not possible.

HTML Scraping

HTML is the markup language used in all websites on the Internet. You can access data from an HTML page using the URL for the page, and an XPath expression to extract the data. Refer to the XML example for a description of XPath.

Bot Libre supports HTML scraping with Self, and AIML.

HTML Example

You can access HTML data from Self using a Template object in a response, or from a script. The Http class is used calling the requestHTML method and passing the URL, and an XPath expression that extracts the desired data from the HTML document.

This example is also available in our script library here

AIML HTML Example

You can access a web service from AIML using the SRAIX tag. SRAIX is an AIML tag used to call other services, or other bots. SRAIX has several attributes, the service must be set to HTML to access an XML service, and the URL is given as the SRAIX body. An XPath expression must be provided to the call to extract the desired text data from the XML document.

This example is also available in our script library here

Facebook, Twitter, Telegram, Email, SMS, RSS

Bot Libre provides several other classes in Self for accessing other services, such as Facebook, Twitter, Telegram, SMS, email, RSS feed, and more.

For example, if your bot is connected to a Twitter account, you can have the bot send a tweet using:

Twitter.tweet("hello world");

This can be used to forward posts from one service to another, or escalate a chat session to email, or notify a human agent using SMS. There lots of examples scripts, here.

When you can connect your bot to the whole world, the possibilities are endless. We can't wait to see what you will build.

Friday, June 17, 2016

How to add a virtual agent to your website

A virtual agent is a term typically used to describe a type of chat bot used for business.

A virtual agent could be a virtual sales agent, a virtual customer service agent, or another type of virtual agent. A virtual agent is an automated version of a human customer service agent.

There are many virtual agents on the Internet, on websites and on social media. They offer help with websites, give information about their companies products or services, answer users questions, provide support, sales, and customer service.

Bot Libre makes it easy for you to create your own chat bot, or virtual agent.

You can create your own bot, and embed it on your own website, or mobile app. You can create bots for website help, technical support, sales, marketing, customer service, or to automate social media.

Bot Libre bots require no programming, and can be trained easily using several methods. Bots can be trained by importing FAQ's, scripts, and chat logs, reviewing and editing responses from our Admin Console's Training & Chat Logs page, or through conversations with you and other people, or from listening in on live chat.

Bot Libre bots supports advanced artificial intelligence that can be enabled to let bots learn and comprehend language. Bots can also be scripted and programmed using AIML, and the Self (a dialect of JavaScript).

To create your own bot follow the steps in the how to How to create your own chat bot in 10 clicks

Once you have created your bot, you can 'Edit' it to change any of its information. You can change your bot's picture or choose an animated avatar from the Avatars page in its Admin Console. You can also connect your bot to Twitter, Facebook, or email, or have it join an IRC chat room. You can import chat logs, or words from Wiktionary, or data from WikiData. You can browse the internal structure of your bots memory. If your are an advanced user, you can program or script your bot using AIML or Self. You can view your bot's log.

To link to your bot you can select it and copy its URL from your browser, this is its unique URL. You can also embed your bot on your website or blog, you can learn how from the Embed page. To get to your bot's Embed page click on its Embed button.



The Embed page generates the HTML/JavaScript code required to embed your bot on your own website. Simply copy the code in the top text area, and paste it into the page on your website you want the bot to appear on.

The Embed page provides several different types of embedding, and many embedding options to control the look of the bot on your page. The "Box" embedding option is the most common for a virtual agent, and gives you a "Chat Now" button on your page.

The embed page also lets you enter a CSS styles sheet to customize the look and feel of your bot's popup. You can also customize the style settings in the generated code.

The embedding code uses JavaScript, and the open source Bot Libre JavaScript SDK. You can customize the JavaScript however you wish. There are also more embedding options available in the JavaScript object, such as prompting the user for their contact information.



Once you add the code to you website, you will get a "Chat Now" button on your website. When users click the button your virtual agent will popup in-page offering its help.



If you also want to add live chat to your website, you can do that by creating a Live Chat Channel, and getting its embed code from its embed page.

That's it, good luck creating your bots. If you have any questions you can contact support@botlibre.com, or chat with the Help Bot

Tuesday, June 14, 2016

How To Connect your Bot to SMS Text Messaging

Through Bot Libre, you can now send and receive SMS messages with your own bot. You can use this to chat with your bot through SMS, but the possibilities are endless. You could also use it to perform surveys or marketing, send customer service escalations, or send notifications from social media or email. Any bot can be set up with SMS text messaging with an account on Twilio.com. This "How To" will give you a step by step process to connect your bot with Twilio to allow for SMS text messaging.

Step 1 - Create a Bot 

First you must create a bot that you want to connect to SMS Text Messaging, or you can use one of your existing bots. To create a bot, follow the instructions here: How to create your own chat bot in 10 clicks

Step 2 - Create a Twilio account

Click here to go the Twilio website. To create a trial account, click on the "+ Sign Up" link in the top right corner of the website.

Enter your information on the following form, then click the "Get Started" button.

You will then need to enter a phone number to receive a verification code.

Once you have received your verification code, enter it on the following screen and press "Submit" to complete your account creation.

Step 3 - Get a phone number from Twilio

From the menu on the left side of the Twilio website, select "Phone Numbers"

 

Click the "Get Started" button to begin. Next, click the "Get your first Twilio phone number".

A screen will pop up with a phone number that has been chosen for you. You can accept this phone number by clicking the "Choose this Number" button. If you want to try again for a different phone number, you can click the underlined "Search for a different number" link. Ensure the number you select has SMS capabilities.

Step 4 - Connect webhook

Navigate to your bot's page on the Bot Libre website. Go to its admin console by clicking on the gear icon.

Click the "SMS" link to view your bot's SMS settings. Copy the "Twilio Webhook URL" to your clipboard.

Now return to the Console on the Twilio website and select "Phone Numbers"

Next, select "Manage Numbers"

Select the phone number you created to edit its settings.

Scroll down to the "Messaging" section and select "Webhooks/TwiML" from the "Configure with" dropdown menu. Paste the Webhook URL from your bot's SMS admin page into the "A message comes in" Webhook field.

Your bot should now be able to reply to SMS messages sent to the phone number you set up on Twilio. Trial accounts on Trilio can only send messages to phone numbers you have verified in the phone numbers section of your account portal. To remove this restriction, you will need to upgrade your Twilio account.

Step 5 - Accessing SMS from a script

 To send SMS message's from a bot's script, you will need to enter your Twilio account's SID, Auth Token and phone number into your bot's SMS admin page. You can find your Twilio Account SID and Auth Token on your Account Dashboard on the Twilio site.

Return to your bot's SMS admin page and enter your Account SID into the Twilio SMS SID field, the Auth Token into the Twilio SMS Secret field and your Twilio phone number into the Twilio Phone Number field. Press "Save"

You will now be able to send SMS messages from your bot through scripts. The method for sending an SMS message from a Self script is Twilio.sms("+16131234567", message); The first parameter is the phone number the SMS message will be sent to. The second parameter is the message that will be sent to the number. For an example of how to do this, please look at the source for this script: https://www.botlibre.com/script?id=12864737


In summary, your bot should now be able to send and receive SMS messages. By creating a Self script, you will be able to create custom behaviour for sending SMS messages in response to chat messages sent to your bot. If you encountered any issues, or would like help setting up your bot please email us at support@botlibre.com or upgrade to our Platinum service and we can build your bot for you.

Saturday, May 14, 2016

How To Connect a Bot to Facebook Messenger

Keeping up with social media and keeping your online community engaged can be a time consuming task. Through Bot Libre you can now automate your Facebook presence with your own Facebook Messenger bot. Any Bot Libre bot can be connected to a Facebook Messenger page account. The bot will reply to your users questions in real-time using the responses of script you have trained your bot with.

Connecting a bot to Facebook is a bit of a process, as Facebook requires a lot of permissions and validation to be setup to allow a bot on their platform. This "how to" give you a step by step process to connecting your bot to Facebook Messenger.

Step 1 - Create a Facebook Page for your bot.

After you have logged in to your Facebook account, you can create a page by clicking on the menu at the top-right of the page and clicking “Create Page”.

You must then select a category for your page. Choose a category that will make sense for your bot.

Fill out the details for your page to finish creating it.

Step 2 - Create a Facebook App for your bot.

Go to http://developers.facebook.com and click on the Register button. Accept the Facebook Platform Policy and Facebook Privacy Policy to continue.

You will need to verify your account by adding a phone number and entering a confirmation code sent to you by text message or phone call. You may also verify your account by adding a credit card.

On the following screen, select the "basic setup" option at the bottom.

Next, you will have to enter a Display Name, Contact Email and Category for your app.

After you have entered the required details, click the "Create App ID" button. This will take you to the following screen.

Note your App ID and App Secret, you will need these in following steps.

Click on the "Settings" tab on the left hand side of the screen underneath "Dashboard" to bring you to the following screen.

Click the "+ Add Platform" button at the bottom and select "Website". Fill in the Site URL with "http://botlibre.com", then add "http://botlibre.com" to App Domains as follows.

Step 3 - Create a bot

Next, you will need to create a bot to connect with your Facebook Page and App. You can follow the instructions here to create your bot: How to create your own chat bot in 10 clicks

Step 4 - Connect bot with Facebook

From the Bot Libre website, browse to your bot. Go to the Admin Console by clicking on the gear icon at the bottom.

From the Admin Console, click on "Facebook" to take you to a screen to configure your Facebook settings. Click on the "Advanced" button to open up the following menu.

Enter the "App ID" and "App Secret" from your Facebook App into the corresponding fields on this form.

Next, click "Authorise" button to authorize your bot with Facebook. Click "Okay" to accept any permissions needed by Facebook.

The "Facebook User", "Access Token" and "Page" fields should now have been filled in automatically.

Click the "Connect" button to connect your bot to Facebook.

Now scroll down to "Facebook Bot Properties" and click "Facebook Messenger (realtime messages)" to toggle it on. Press save.

Copy the "Webhook URL" to your clipboard for use in the next step.

Step 5 - Set up Webhook URL with Facebook

Go to your Facebook App's dashboard webpage. Select "Webhooks" from the menu on the left.

Click the "New Subscription" button on the top right and select "Page" from the popup to open up the following menu.

Enter the "Webhook URL" you had copied in the previous step into the "Callback URL" field. Enter "token" into the "Verify Token" field. Select only "messages" in the "Subscription Fields".

Click the "Verify and Save" button to finish.

Now select "Messenger" from the left menu, underneath "Webhooks" to see the following menu.

Under "Token Generation", click the "Select a Page" dropdown and select your bot's Facebook Page. Copy the generated "Page Access Token" to your clipboard.

Then, under "Webhooks", click the "Select a Page" dropdown and select your bot's Facebook Page. Click the "Subscribe" button that appears right beside it.

Now return to your bot's "Admin Console" on the Bot Libre website. Go to the "Facebook" tab and paste the "Page Access Token" you had previously copied into the "Facebook Messenger Page Access Token" field.

Press "Save".

Step 6 - Approval by Facebook

At this point, you should be able to send messages to your bot's Facebook Page with the Facebook user who created the page, and your bot will respond.

For other Facebook users to be able to send and receive messages with your bot, you will need to have your Facebook App approved by Facebook.

Click on the "App Review" tab on the left menu. Click the "Start a Submission" button.

Select the "pages_messaging" login permission, then click the "Add 1 Item" button.

You may need to complete additional details in the "App Details" tab before you can complete your submission. You will need to upload an app logo and provide a URL to your privacy policy.

Next return to the "App Review" tab and click the underlined "notes" underneath "pages_messaging".

Complete the details in the following pop up. You will need to upload a video of you chatting with your bot on Facebook at this step. You can record this with software such as CamStudio or Quicktime.

When you have completed all required details, click the "Submit For Review" button.

After some time, Facebook should approve your App.

Toggle the "Make _APP_NAME_ Public" button to make it available to the public and have other users be able to interact with your bot.

While you are waiting for Facebook to approve your Facebook App, we also support polling for messages which will allow users to interact with your bot in the meantime.

To enable this, return to your bot's Admin Console on the Bot Libre website and go to the "Facebook" tab.

Click "Reply to messages (poll for messages)" and then "Save" to enable this feature. This does not require Facebook to approve your App.

You should disable this feature once your Facebook App has been approved, otherwise your bot will reply to messages twice.

If you got this far, congratulations, you have now connected your bot to Facebook Messenger. Now you can train your bot's responses and review its conversations from its "Training & Chat Logs" page in its Admin Console. If you encountered any issues, or would like our help setting up your bot please email us at support@botlibre.com or upgrade to our Platinum service and we can build your bot for you.