Part 2 Tutorial


The greatest strength of the greenFusion or Personality Forge bots is the ability to create complex memories and easy implementation of conditional responses.  For example : if the "name" value had been initiated as "seeker" you can use the following structure.


what is my name [10,0]

     Your name is (mem-name). <?PF if (mem-name) is not "seeker"; ?> 

     Well, you have not told me your name yet. What is your name? <?PF if (mem-name) is "seeker"; ?>

        + my name is, call me [0]

        Nice to meet you (Postkey)<?PF rem (Postkey) as only "name"; ?>

        +  is my name [0]

        Nice to meet you (Prekey)<?PF rem (Prekey) as only "name"; ?>

        +  (*) [0]  <?PF rem (Key1) as only "name"; ?>

        Nice to meet you (Key1) :-)  Do you really want me to call you (Key1) ?

            + yes [0]

            Ok

           + no [0]  <?PF rem "seeker" as only "name"; ?> // reset "name" to default

           OK, lets try again, but this time do it properly and say, my name is...


 

Memories are initiated in the mindfile.txt

AIScript: def "seeker" as "name"; def "football" as "likes";


"name" is usually initiated as "seeker" or "friend".  A.L.I.C.E. uses "seeker", Verbot uses "friend". Personality Forge uses "guest4545" or other number for unregistered clients. 


All kinds of memories can also be initiated anywhere in the mindfile. E.g.  The only restriction is that they should be a single word. 


I went to a museum [10,0]  <?PF rem "museum" as "youwentto"; ?>


went to a [5,0]  <?PF rem (postkey) as "youwentto"; ?>


went to a (*) yesterday [5,0]  <?PF rem (key1) as "youwentto"; ?>


If you try to use a non-existent, uninitiated memory in an if statement of a response that would simply mean that this response will never be selected.


Note that (key1) is a (*) .  There can be up to 5 such keys.  e.g. A (*) fox jumped over a (*) dog .  Here the first (*) is (key1) and the second (*) is (key2).

(prekey) is the part of the sentence before the match  e.g. is my name [0]  If the client were to say Roger is my name then "Roger" is the  (prekey).


If you wish a key to be capitalized - use (Key1), (Postkey) instead of (key1) and (postkey).


This can enable to have this conversation:


Client: my name is test

AI: Nice to meet you Test.

Client: what is my name

AI: Is it Test?

As can be seen the Client's name was capitalized. It is also possible to save a (key) as a non-capitalized word, but have it capitalized in a response by using (Mem-name), or the bot may use a not-capitalized (mem-name) form if you wish to create a petulant bot personality that would not capitalize your name if you insult it.


Very complicated bots can be written with skillful use of conditional statements.  Just like a human your bot can give very different answers to the same question depending on context.  In real life context is everything. Emotional states provide the botmaster with some level of control.  If the emotional state is very low, this would indicate that the person chatting to the bot is either abusive or very upset.  In any case the bot picks up the client emotional state even without understanding any of the input.  It is up to the botmaster to decide if your bot becomes hostile or soothing in response. Using emotions for logic control is rather imprecise. But the conditional statements can be as precise as desired.


The only limit is your imagination and the time you are prepared to invest into your creation. 




© GreenFusion Enterprises 2013-2014