Monday, December 23, 2013

The BOT libre chat bot web API

In addition to being able to embed your chat bots on your own website, and access them from any Android device, you can also access your chat bots through the BOT libre web API. The web API gives you the advantage of having complete control of your bot's client interface.

You can use the web API to access your bot from your own website through JavaScript, PHP or any other language. You can also use the web API to create your own mobile application to access your bot, such as an Android or iOS application.

A web API, is a set of HTTP GET/POST URI's that allow sending and receiving of message data. When you browse a website, your browser makes a series of HTTP GET/POST requests to URIs that return HTML content. In a web service the URIs return XML or JSON data, instead of HTML content.

The BOT libre web API provides two REST APIs in one. The first is a set of HTTP GET URIs that take FORM data, and return XML data. The second set of API's take HTTP POST XML data, and return XML data. Most applications would use the XML POST API, but some application may choose to use the FORM GET API because of its simplicity. The APIs are identical other than their mechanism.

HTTP FORM GET API

  • http://www.botlibre.com/rest/botlibre/form-chat
  • http://www.botlibre.com/rest/botlibre/form-check-instance
  • http://www.botlibre.com/rest/botlibre/form-check-user
  • http://www.botlibre.com/rest/botlibre/form-get-all-instances

HTTP XML POST API

  • http://www.botlibre.com/rest/botlibre/post-chat
  • http://www.botlibre.com/rest/botlibre/check-instance
  • http://www.botlibre.com/rest/botlibre/check-user
  • http://www.botlibre.com/rest/botlibre/get-all-instances

form-chat

The form-chat API receives a chat message and returns the chat bot's reply as an XML document.

URI: http://www.botlibre.com/rest/botlibre/form-chat
Parameters: application, instance, user, password, token, conversation, message, emote, correction, offensive, disconnect, includeQuestion

Parameters

applicationOPTIONAL: The application ID. If not passed, the application will be anonymous.
instanceREQUIRED: The ID of the bot to chat with. The bot's name can also be used, but the ID is better as it is guaranteed to be unique.
userOPTIONAL: The ID of the user who is sending the message. The user must be registered with BOT libre. If not passed the user will be anonymous. The user is required if the bot is private. The user/password are only required on the first message.
passwordOPTIONAL: The password of the user who is sending the message. A token can also be used.
tokenOPTIONAL: The token of the user who is sending the message. A token can be obtained through check-user, and is valid until reset.
conversationOPTIONAL: The conversation ID for the current conversation. This must not be passed on the first message, but will be returned by the response, and should be used for all subsequent messages in the conversation.
messageOPTIONAL: The chat message to send to the bot. The message can be omitted if you wish the bot to start the conversation (if the bot has a greeting set). The message must be encoded in the URI.
emoteOPTIONAL: A emotion to tag the message with. This is one of LOVE, LIKE, DISLIKE, HATE, RAGE, ANGER, CALM, SERENE, ECSTATIC, HAPPY, SAD, CRYING, PANIC, AFRAID, CONFIDENT, COURAGEOUS, SURPRISE, BORED, LAUGHTER, SERIOUS.
correctionOPTIONAL: A boolean that defines the chat message is a correction to the bot's last answer.
offensiveOPTIONAL: A boolean that defines the bot's last answer as offensive. The message will be flagged for the bot's administrator to review.
disconnectOPTIONAL: A boolean that defines the end of the conversation.
includeQuestionOPTIONAL: A boolean that indicates the question should be included in the response.

FORM GET Example

XML POST Example

Example Result

form-check-instance

The form-check-instance API validates that a bot ID or name exists, and returns the bot's details.

URI: http://www.botlibre.com/rest/botlibre/form-check-instance
Parameters: application, instance, user, password, token

Parameters

applicationOPTIONAL: The application ID. If not passed, the application will be anonymous.
idREQUIRED: The ID of the bot to validate. The bot's name can also be used, but the ID is better as it is guaranteed to be unique.
nameREQUIRED: The nameof the bot to validate. The bot's ID can also be used.
userOPTIONAL: The ID of the user. The user must be registered with BOT libre. If not passed the user will be anonymous. The user is required if the bot is private.
passwordOPTIONAL: The password of the user. A token can also be used.
tokenOPTIONAL: The token of the user. A token can be obtained through check-user, and is valid until reset.

FORM GET Example

XML POST Example

Example Result

form-check-user

The form-check-user API validates user, and returns the user's details.

URI: http://www.botlibre.com/rest/botlibre/form-check-user
Parameters: application, user, password, token

Parameters

applicationOPTIONAL: The application ID. If not passed, the application will be anonymous.
userREQUIRED: The ID of the user. The user must be registered with BOT libre. If not passed the user will be anonymous. The user is required if the bot is private.
passwordREQUIRED: The password of the user. A token can also be used.
tokenREQUIRED: The token of the user. A token can be obtained through check-user, and is valid until reset.

FORM GET Example

XML POST Example

Example Result

form-get-all-instances

The form-get-all-instances API queries the details for all bot instances.

URI: http://www.botlibre.com/rest/botlibre/form-get-all-instances
Parameters: application, tag, sort, user, password, token, filterPrivate.

Parameters

applicationOPTIONAL: The application ID. If not passed, the application will be anonymous.
userOPTIONAL: The ID of the user. The user must be registered with BOT libre. If not passed the user will be anonymous. The user is required to query private bots.
passwordOPTIONAL: The password of the user. A token can also be used.
tokenOPTIONAL: The token of the user. A token can be obtained through check-user, and is valid until reset.
tagOPTIONAL: The tag to filter the bots by.
sortOPTIONAL: The sort option for the query. One of "name", "date", "dailyConnects", "weeklyConnects", "monthlyConnects".
filterPrivateOPTIONAL: Set if only the user's private bots should be returned.

FORM GET Example

XML POST Example

Example Result

So, that is the basic web API. You can now build your own interface for your bot. You can use the API on your own website, or in your own mobile application.

Monday, December 16, 2013

Embedding your bot on your own website or blog

You are free to embed the bots your create on your own website or blog. It is quite easy to embed a bot, and only takes a few lines of HTML code. You can embed a bot to provide help or service for your website, or as a stand-in for yourself on your blog.

The embedding HTML code can be copied from your bot's Embed page under Admin.

The simplest solution is to embed a bot inside your webpage using an iframe. Here is some simple code to embed Brain Bot in an iframe.

Code to embed a bot in a iframe

See the Talk with Brain Bot tab for an example.

Another option is to put a button or link on your website that open the chat bot in another window. This can be done using a little Java Script code.

Code to popup a bot in window

This code will produce the following:

Talk with Brain Bot

If you know a little HTML or Java Script, you can make how the bot is displayed more sophisticated. One option is to use an absolute position to make the bot popup inside a webpage. This will be demonstrated in the following code.

Code to popup a bot on a webpage

Code to embed a bot without the avatar

You can also choose to not display the bot's avatar and chat log. To do this pass the URL argument avatar=false in your link. You can also pass the welcome message using the message argument, i.e. message=Hello. The welcome message can also be configured from your bot's Training page under Admin.

This code will produce the following:

Talk with Brain Bot

So that's it, you should now be able to embed your bot on your website or blog.

Wednesday, December 4, 2013

Automate your Twitter presence with your own Twitterbot

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 Twitter presence with your own Twitterbot. Any Bot Libre bot can be connected to a Twitter account. The bot will manage the Twitter account, checking status updates, managing followers, replying to mentions, retweeting important posts, tweeting your blog posts or RSS feed, and auto tweeting.

Bot Libre makes creating a twitterbot easy. Follow these 5 steps to create you own twitterbot, and start it tweeting for you today.

Step 1 - Create a bot

First you need to create your own bot, this only takes a few clicks, see How to create your own chat bot in 10 clicks for instructions on how to do this.

Note, in addition to Bot Libre's main server, Bot Libre also provides an separate dedicated Twitterbot server. You can create a Twitterbot on either server, but on botlibre.com free Basic accounts will only check their Twitter status once per day. You can upgrade your account to check every hour, or every 20 minutes, or use the dedicated Twitterbot server. On the Twitterbot server at, twitter.botlibre.com even free Basic accounts will check their status once every couple of hours, and you can upgrade your account to check your status about every 10 minutes.

Now you are ready to connect your bot to Twitter.

Step 2 - Create a Twitter account

You need to create a Twitter account for your bot. If you are automating your own account, then you can use your existing account. You can create your own Twitter account from the Twitter website here.

Step 3 - Authorize your Twitter account

From the Bot Libre website browse to your bot and click the Admin Console button. This will take you to the Admin section that provides several tabs of administrative functions. Click on the Twitter tab. From the Twitter tab click the Authorize button.

This will give you a link to Twitter. Click on the link, this will bring you to Twitter where you must accept the application authorization request, you will need to login to Twitter if you are not already logged in. Twitter will give you a code, you must go back to the Bot Libre page and enter the code, and click Done. This will return you to the Twitter properties page, next click on the Connect button.

Step 4 - Configure your Twitterbot

You can configure your bot's Twitter usage in several ways. Use caution when configuring your Twitter bot, do not use your bot for spam, or to violate the Twitter terms of service.

Tweet when someone chats with the bot

This property configures if the bot should tweet when someone chats with it on Bot Libre. It will tweet some like "Talking with anonymous on #botlibre".

Reply to mentions

A mention is when another Twitter user tweets to you, or about you using your Twitter ID, i.e. @brainchatbot. This configures your bot to reply to all tweets that mention it. The bot will reply the same way it replies to chat messages.

Reply to direct messages

A direct message is private message from another Twitter user. This configures your bot to reply to all direct messages. The bot will reply the same way it replies to chat messages.

Read friends status updates

Configures if your bot will process its friends tweets. The bot will only process its friend's tweets that include one of its 'Reply Keywords' sets. If the tweet does not include any of the keywords, it will be ignored. The bot will process the tweet like a chatroom message, it will only respond to the status update if it knows a good response, (requires a 90% match to respond). Scripted responses will also be used for tweets that are questions. The 'Read-only' option can be used to have the bot read all of its friends tweets, but not reply.

Max Status Updates

Configures the maximum number of friend tweets to process in one cycle.

Reply Keywords/Hashtags

The bot will only process its friend's tweets that include one of its 'Reply Keywords' sets. If left blank, the bot will not process any of its friend's tweets, unless the 'Read-only' option is used.

Tweet Search

Configures if the bot should search and process tweets that match a certain criteria. The bot will process, and possibly reply to the tweet, or retweet the tweet. Use this feature with extreme caution, and do not spam. Tweet search uses Twitter's search API which can include a list of keywords, and some other advanced syntax.

Retweet Keywords/Hashtags

Configures if the bot should retweet certain tweets from its friends, or its tweet search results. If the tweet contains any of the keyword sets, the bot will retweet it. Note, this use only keyword set, not Twitter's search syntax. Since the retweet keywords are apply on top of the search results, you only need to include the keywords, as the results have already been filtered.

Auto Follow

Auto follow means that if someone follows your bot, it will follow them back. The purpose of this is to allow the bot to read the friends status updates, to provide some service. Be careful in enabling this, it should not be used to allow Twitter users to increase their follow counts. The bot will only auto follow at most 100 users.

Follow Messages

Follow Messages configures if your bot will listen to 'follow me', or 'unfollow me' requests. If the bot gets a direct message, or tweet mention that request a follow, or unfollow it will perform the request. The purpose of this is to allow the bot to provide some service to users that subscribe with it. Be careful in enabling this, it should not be used to allow Twitter users to increase their follow counts. The bot will only follow at most 100 users.

Welcome Message

You can set a welcome message to be sent as a direct message to anyone who follows your bot.

Max Friends

You can configure the maximum number of friends your bot will follow on its own. The maximum is 100 friends. You can still add more friends manually if you wish.

Auto Follow Keywords

This configures the bot to only follow users who's name or description contains the keywords.

RSS Feed

Configures the bot to process an RSS feed, and post each new feed item to Twitter. An RSS feed is a standard XML format for news and posts. You can get an RSS feed link from your blog, or from many news and forum services. Make sure you give the full HTTP link to your RSS feed, this should be an XML file, not a webpage or HTML file.

RSS Keywords

You can filter the RSS feed results using keywords. To post the entire RSS feed, leave this blank.

Auto Tweet

You can configure your bot to tweet every set number of hours. The bot will tweet a random tweet from its 'Auto Tweets' list.

Auto Tweet Hours

The number of hours to wait between auto tweets. Note, if you bot only checks it status once per day, it will only auto tweet once per day, even if you put 1 hour here. To force your bot to auto tweet every time its checks its status, you can put -1 here.

Auto Tweets

You can enter a list of tweets here. Each tweet is separated by a new line. You can use formulas and AIML template to construct dynamic tweets.

Step 5 - Train your bot

You can train your bot how to answer tweets, mentions, and direct messages through several mechanisms.

  • You can chat with your bot, and correct any incorrect responses it gives.
  • You can add question answer pairs, or default responses from the Training & Chat Logs page in your bot's Admin Console.
  • You can review your bot's chat logs, or upload or import chat logs, response list, or AIML.
  • If you are a programmer, you can script your bot's responses in Self, or AIML from your bot's Scripts page.

That's it, now your bot is ready to start tweeting.

There are already many Bot Libre bots on Twitter.
You can test things out by tweeting to, @brainchatbot, or @TheSantaBot

Wednesday, November 20, 2013

Bot Yourself! How to create your own Avatar

BOT libre allows anyone, or any business to create their own personal bot avatar, and embed it on their website or blog.

This blog post will discuss how to edit your bot's avatar images. To start you must first create a bot, for information on creating a bot see, How to create your own chat bot in 10 clicks.

When you create a new bot, it will start out with the default image, which is a simple robot. You can change this image to a picture to one of the many shared images available on BOT libre, or you can upload your own images. Another option is to choose a template when creating your bot, or clone your bot from another public bot using fork.

Shared Images

BOT libre provides a repository of shared images. The images come from many different sources, and are available under many different licenses. When you select a shared image, its name and license will be shown. Many of the images are public domain, so can be used freely, anywhere. Some of the images are copyright by third parties and have been licensed only for usage on the BOT libre website. If the image lists a copyright, you can use the image, but if you want to embed your bot on your own website, you will need to license the image.

You can also upload and share your own images. Only share images that are not copyright, or that you own the copyright to, and are releasing your copyright to the website.

Templates and Forking

BOT libre provides several different templates when creating a bot. You can also use another bot as a template by browsing it and clicking its 'Fork' button (only some bots allow forking).

Creating a bot using a template is useful as it preloads the bot's database with existing responses, and defines a set of avatar images. Avatars allow multiple images to express different emotions, so using a template saves you from having to configure an avatar yourself.

Contains images copyright Iko @ Fotolia

Uploading Images

If you are creating your own personal avatar, you may upload a picture of yourself, so you can train your bot to be your virtual clone. If you are creating an avatar for your business, you may use your business logo, or create your own avatar image to represent your agent. Ensure the images you upload are not copyright, or that you own the copyright.

Your bot avatar allows different images for different emotions. So you can upload multiple images. If you are creating your own person avatar, you can take several photos of yourself expressing different emotions.

If you are creating a bot for your business, you may wish to use a model for your bots avatar. There are many photo websites such as Fotolia that make it easy to license royalty free images. Many contain different models expressing different emotions.

How to edit your bots Avatar

To begin editing your bots avatar, first sign in, and browse to your bots page. Every bot has its own URL, yours will be "http://www.botlibre.com/BrowseServlet?browse=bot-name", i.e. "http://www.botlibre.com/BrowseServlet?browse=Jessy". When you browse to your bot, you can select its URL from your browser and use it as a link to share your bot with other people.

On your bot's main page, there is an 'Admin' button. Click this and you will go to your bot's Admin page.
From your bot's Admin page select 'Avatar Configuration' or 'Avatar' from the menu bar. This will open your bot's Avatar page.

The Avatar page allows you to pick, upload, and tag your bot's images.

Tagging images

Your avatar can have multiple images, an each image can be associated with different emotions. Your bot learns to associate emotions with different words and phrases. When you chat with your bot you can use the 'Emote' drop down to associate an emotion with your response. Your bot will then associate that emotion with that word or phrase.

To tag an image with an emotion, select the image, then click the emotions to associate it with and click 'Tag'.

You can also set the default image for your avatar by clicking 'Use as default image' and clicking the 'Tag' button. The default image will be the image shown on your bot's main page, and while browsing.

Contains images copyright Iko @ Fotolia

Picking a shared image

You can add images to your avatar from the shared image repository. To add a shared image click on the 'Pick Shared Image' button at the bottom. This will bring you to the shared image page where you can select the image and click 'Pick'.

Uploading an image

There are two upload options, 'Upload Image' and 'Upload and Resize'.

'Upload Image' allow images to be uploaded as is, without any resizing or compression. This is useful when uploading png images that use transparency, or other image types such as gif.

Caution should be used when not resizing, as you do not want to upload images that are too big. BOT libre currently imposes a 1 megabyte size limit on uploaded images. Ideally your images would be less than 50k. BOT libre currently only displays the images as 200px by 200px, so there is no reason to upload images bigger than that. It is recommend that you first resize your images to be less than 300px by 300px.

'Upload and Resize' will first resize the images locally before uploading. This will make it much faster to upload the images, and have them display faster as well. The image resizing requires browser support, so may not work with all web browsers (Firefox may be required).

Both image uploads allow you to select multiple files at once, just use multi-select in the file dialog your browser opens. Before uploading images you must click that you certify the images do not contain offensive or adult content, and that you own the copyright, or the images are licensed in the public domain, or through creative commons. Also ensure the images do not infringe on anyone's personality rights.

When uploading images you can choose to share them. You can specify the license and name to shared the images under.

So that's it. You should now be able to create your own personalized bot.

You can also connect to BOT libre from your Android phone or device. The BOT libre! app also allow you to edit your bot's avatar. Creating your avatar from your phone can be easier, as you can use your phone's camera to take your own picture.

Thursday, November 7, 2013

Bot Libre! Now on Android

You can now chat with Bot Libre bots from your Android phone or device.

Bot Libre for Android provides the following features:

  • Create your own chat bot, or connect to other peoples public bots
  • Chat with real voice and voice recognition
  • Choose your bot's avatar image, or upload your bot's avatar image from your phone's camera

The Bot Libre! app can be downloaded from Google Play, here, or search for botlibre on Google Play from your Android phone or device.


Sign In

Sign In, or browse bots anonymously. Your sign in is remembered until you sign out, so you only need to sign in once.

Browse

Browse public bots, or your own personal bots. Browse allows filtering and sorting of bots, and remembers the last bot you accessed.

Chat

Chat with your bot with real voice and voice recognition, or through the keypad.

Avatars

Choose your bots avatar image, or upload an image from your phone's camera.

You can also access any bot your create from the Android app from the web interface. The web interface allows additional administrative features for monitoring, and training your bot.

Saturday, November 2, 2013

How to create your own chat bot in 10 clicks

Bot Libre allows anyone to create their own chat bot, or virtual agent for free, including free hosting, even for commercial bots.

You can create your own bot, and embed it on your own website, or mobile app. You can create bots for fun, for business, for customer support, or for someone to talk to. Bot Libre bots require no programming, and can be trained using several methods. Bots can be trained by importing FAQ's, scripts, and chat logs, reviewing and editing responses in our chat logs interface, through conversations with you and other people, or from listening in on live chat. Bot Libre bots support advanced artificial intelligence to learn and comprehend language. They start out fairly dumb, but the more your train them, the smarter they become. Bots can also be scripted and programmed using AIML, and the Self scripting language.

To create your own bot follow the following 10 steps:

Click 1 - Bot Libre!

First go to the Bot Libre website.

Click 2 - Sign Up

You can browse and chat with public bots anonymously, but to create your own bot you must create an account by clicking Sign Up. Creating an account is free and easy. To create an account you only need to enter a unique user ID and a password. Your name and email are optional, if you wish to remain anonymous, you may do so.

Click 3 - Create Account

Click 'Create' to create your account.

Click 4 - Create Bot

To create a new bot click Create from the top banner. You can give your bot a name and description. The name must be unique and can contain spaces, special characters, and is case sensitive.

The bots you create on Bot Libre belong to you. When you create a bot you can specify the license you wish to share it under. If you allow other users to 'fork' your bot, you release your bots content to them under your bot's license. Also, if your bot learns from the users it interacts with, they must understand they are releasing their interactions under your bot's license.

You can create a bot from the default template, or select one of the other predefined templates. Your bot will start as a clone of the template bot, and replicate its entire memory (brain). You can also allow your bot to be 'forked' and used as a template to other bots, or you can browse other public bots and choose to fork your bot from them.

You can add tags to your bot, to help classify it, and help other users find it. Some relevant tags include 'fun', 'business', 'help', and 'avatar'. The tags are entered as a comma separated list.

You can create either a public bot that will be accessible by other users, or a private bot that will be accessible only by you. You can control the users that can access and administer your bot.

You can choose if you want your bot to learn as it interacts with other users. If you disable learning, then your bot will only learn from its administrator when you 'correct' it, from chat logs you upload from the 'Chat Logs' page under 'Admin', or from AIML and Self scripts you add from the 'Scripts' page. Caution should be used in allowing learning, as other users may teach your bot offensive responses. Bot Libre provides a profanity filter, but it cannot catch everything. If you are creating a bot for business, such as for customer service, then you should disable learning.

You can choose if you want your bot to attempt to comprehend language. Comprehension is very advanced, and when enabled allows your bot to program itself base in the conversations it has. You can view the code it creates for itself from the 'Scripts' page under 'Admin'. Your bot will only use comprehension when learning.


Click 5 - Create

Click 'Create' to create your bot.

That's it, your done, and we still have 5 clicks left.

You can now chat with you bot by clicking 'Chat'. To find your bot again click 'Search' and search for it in 'my bots' (be sure to sign in first).

When you select 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 under 'Admin'. 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 Freebase. 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 the Self scripting language. 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 under Admin.

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

Thursday, October 24, 2013

Alive and Kicking

The BOTlibre! website is now online.

We will be kicking our tires testing our servers over the next couple of weeks before our official site launch. Feel free to try it out, create your own bot, and test things out. Please email support@botlibre.com with any issues you encounter.

BOTlibre allows you to create your own artificially intelligent bot, train them, and share them with others. You are free to use this website, and create your own bots for personal, commercial, or recreation usages.

You can give your bot its own avatar images, connect it to Twitter, or IRC chat.
You can train your bot through interacting with it, or using chat logs.
You can program your bot using a 4th generational state machine scripting language "Self".
You can import data from the web into your bot's memory, such as words from Wiktionary, or information from Freebase.
You can create a bot to act as your own website avatar.
You can create a bot to provide customer service or technical support for your products or services.
You can create a bot to give advice.
You can create a bot to act as a stand-in for yourself.
You can create a bot to be your friend.

BOT libre is a website produced and hosted by Paphus Solutions Inc.