Category: Perl
I'm releasing an alpha version of my Perl chatterbot I've been working on - AiRS - Artificial Intelligence/RiveScript!
It's a full featured Perl chatterbot that can sign bots on to AOL Instant Messenger and Yahoo Messenger. It comes with a RiveScript brain and a Chatbot::Eliza brain.
The bot supports easy customization and adding of new brains (the Eliza brain was put in as a second example of how to create your own), so, despite the name of the bot, it's not strictly limited to RiveScript!
Now, as I said, this is an ALPHA release. Version 0.01! So if you're a total newbie and have never touched Perl or a command prompt before, don't ask me to help you get it all set up. There will be plenty of time for me to write thorough documentation for noobs by the time a final version gets released.
If you're not a complete noob though I don't think you'll have too much trouble getting a bot up and running with this code. 
Download Links:
- AiRS 0.01 - The recommended distribution.
- AiRS+ 0.01 - This version also includes a handful of third party Perl modules.*
Net::IM::YMSG is not yet on CPAN (I should have it up by the weekend!), so if you're looking for it, you can find it on Google Code at http://code.google.com/p/perl-net-im/.
There's a bit of RiveScript related news today.
Perl RiveScript 1.22 Released
This was just a maintenance release of the Perl RiveScript module that cleaned up the documentation. But also, the rsdemo script has been replaced with a new rivescript script. It can still be used the same way as rsdemo (to interactively test your RiveScript code), but it can also be used non-interactively.
So, for example, a chatterbot written in C++ would be able to use the rivescript command to add RiveScript support to their program, even though there isn't a native C++ port for RiveScript yet.
New Website
RiveScript.com has been updated to use the Siikir CMS that powers a few of my other sites. With that comes a new web design, and the URLs to pages have been modified a bit, and the site should respond much faster than before.
Future Plans
I have some plans to expand this site in the near future and provide a sort of chatterbot hosting service. Instead of having to download a Perl bot and deal with programming to be able to use RiveScript, there will be an easy-to-use hosted service like what RunABot and some other sites provide.
For people who prefer to develop their own bots, though, I have a big Perl bot I've been working on that can currently sign on to both AIM and Yahoo Messenger. I plan on packaging that code up for release here soon, too, so then you can have a more complete bot to work with than the barebones AIM template on the Getting Started page.
Some news about RiveScript implementations:
- The Perl source code is now hosted at Google Code, here, instead of on my own Subversion server.
- I had started on a C++ port of RiveScript, but it's still in very early development and isn't usable yet. That's also on Google Code.
- The first third-party RiveScript port is being written in C# by Daniel Vinciguerra. It's still in early development, too, and it's hosted on Github.
I've just checked in an update to the RiveScript-java code:
It supports Perl objects now!
So you can use your existing RiveScript Perl objects with the Java library now. Example:
+ encode * in md5
- "<star> in MD5 is: <call>md5 <star></call>
> object md5 perl
my $rs = shift;
use Digest::MD5 qw(md5_hex);
return md5_hex(join(" ", @_));
< object
How does it work? There's a Perl script names "rsp4j.pl" that the Java library calls on. Java sends a JSON-encoded data structure to the Perl script containing the user's ID, message, user variables, and the source code to the Perl object. The Perl script loads the RiveScript Perl module and uses it to evaluate a response to the user. It then outputs a new JSON structure containing the user's reply and their new user variables (in case the Perl object called any setUservars methods on the $rs object).
The 0.02 version of rivescript-java has the Perl support. You can see its usage in the RSBot.java example script, or more generally here's all you need to do to get Perl support:
RiveScript rs = new RiveScript();
rs.setHandler("perl", new com.rivescript.lang.Perl(rs, "/path/to/rsp4j.pl");
I've added a subversion repository where the "bleeding-edge" Perl RiveScript source code can be downloaded.
The general public gets readonly access. The repository can be checked out by running the following command on a unix-like system with subversion:
svn co http://svn.kirsle.net/repos/RiveScript-perl/trunkYou can also browse the repository in your web browser by linking to http://svn.kirsle.net/repos/RiveScript-perl.
If you want write access, you'll have to ask on the forums.
