Program AB, conditions don't work

"My name is" work, but the two other return an empty line in MRL. Someone know what i did wrong ?

I've tested this with "gaiToBot aiml editor" and it work .

Thx

 

<category>
	<pattern>MY NAME IS *</pattern>
	<template><think><set name="name"><star /></set></think>Glad to meet you <star /></template>
</category>

 

<category>
	<pattern>WHAT'S MY NAME</pattern>
	<template>
             <condition name="name" exists="false">I don't know</condition>
             <condition name="name" exists="true">Your name is <get name="name" /></condition>
        </template>
</category>

 

<category>
	<pattern>DO YOU KNOW MY NAME</pattern>
	<template>
             <condition name="name" exists="false">No, </condition>
             <condition name="name" exists="true">Yes, </condition>
             <srai>what's my name</srai>
        </template>
</category>

 

kwatters's picture

Default value for name vs. Exists

I suspect there is a default value for name. So the exists test is probably failing. When I get a chance, I'll add a conditional to the ProgramAB unit test to validate the example and validate.

You can check the predicates.txt file to see which variables have defaults.

beetlejuice's picture

Hi kwatters, and thx .There

Hi kwatters, and thx .

There is effectivelly a predicates stored for nem :

jsenabled:true
name:default
topic:unknown
sex:male
name:Fred
But if the predicates file stay on the hard disk, "name" will alway contain the last name set . Is it possible to reset this value on start ? By exemple set it to "unknow" ?
 
thx
 

 

kwatters's picture

new functions on ProgramAB service

Hi Beetle,

  I just added some helper functions that allow you to set/get or clear a predicate from python.

I'll see about working up a more detailed example.  I wanted to let you know that now you can call something like the following:

 

programAB.removePredicate(session, predicateName)

programAB.setPredicate(session, predicateName, predicateValue)

programAB.getPredicate(session, predicateName)

 

Session is the name of the user talking to the bot, the predicateName could be replaced with  "name"  if that's the one you want to set.

To my surprise when you unset a predicate it wil default to the string "unknown"  ...

happy new year! 

beetlejuice's picture

Thx kwatters's, I'll test

Thx kwatters's,

I'll test that ! I'm still continue to learn aiml I will again ask your help, because "it's better one who know than 10 that search" ( Hummm seems to be that in english "it is better that a hundred knows that looking")

How alice do to grab on the web the things that she doesn't know ? I thinked use <oob> and set a function in python to ask wolframAlpha, but the answer is in english.

Alice seem to grab her info from wikipedia and this one exist in french

Thank you for your help, AIML is very interesting !

An happy new year to you too . Good health and a lot of money !

kwatters's picture

SRAIX vs OOB

Hi Beetle,

  ProgramAB has the concept of calling out to other bots on the web to ask questions.  This is from the use of the SRAIX tags.  I suspect that these are very limited and tied to pandora bots.  The other option is the out-of-band tags.  ProgramAB doesn't have any support for OOB tags by itself, that's something that we've added for MRL.

  As you have probably noticed you can use the OOB tags to call out to any service in MRL including python.  With python you can script it up so that it does any sort of screen scraping or other information gathering.  Python is a more powerful language for doing these sorts of things.

  As for Wolfram alpha, we actually have a Wolfram Alpha service already in MRL.  Last I tested it, it seemed to be worky.  Pretty impressive stuff.  I suspect that you actually want to have some sort of a way to translate the answers from english to french.  We might be able to create some sort of a google translate service ..

  The idea would be similar to the html filter, that it would listen for text, pass it to google translate, and return the translated text.  That sounds like a very cool & fun potential addition to MRL... 

Thanks for your continued interest !  It's because of people like you that I'm motivated to continue to help out here!

  I wish you a very good 2016 also!

  Best,

  -Kevin

One additional comment about the OOB tags is that the result of it isn't included inline with the response from program ab.   I'm looking at extending it to have 2 types of oob tags.. a blocking and a non-blocking version.   the blocking version would be able to return text to be included in the response from programab.  (not done, yet, but that's what i'm thinking ...)