The AI Engine
This forum is for discussion of how The Personality Forge's AI Engine works. This is the place for questions on what means what, how to script, and ideas and plans for the Engine.
Posts 6,549 - 6,560 of 7,766
why not just use the catch all (*) as a seek to where the user would want to store the response as a memory.
That should work fine, so long as you don't need access to any subsets of the input.
But remember to make it a regex (with "(re)",) or it may terminate the match at the first comma, and only save the first clause of a longer input.
Trying to get (key7) to work on of the test bots, it went straight to my private(xnone):
You: but has anyone ever tried a (key7)?
Bot: Are you talking to me?
It's interpreting "(key7)" as the literal string "(key7)", not as a (key) plugin.
You need to give it keys in a keyphrase:
(I|we) (are|have) (been|seen) (a|an) (crocodile|alligator) (at|in) (the zoo|the reptile house)
(key7) will then return either "the zoo" or "the reptile house" if a user says "we have seen a crocodile in the zoo" (because there are 7 non-optional local plugins to match.)
<?PF if (mem-ihave) is not (key5); ?>
That ought to work I think, but what is the keyphrase? It certainly won't work if there is no (key5), or if the memory doesn't yet exist to fill with a value (you might have written the keyphrase, but if it has not yet been triggered (here or somewhere else,) (mem-ihave) will not actually exist yet.)
I had the done for the test bot, I have tried regexes only:
([but,.]+) ([has,.]+) ([anyone,.]+) ([ever],.]+)([tried,.]+) ([a,.]+) ([key7,.]+) (re)
and variations on that theme, it didn't work, perhaps I need to brush up on my skills, maybe later.
I always have trouble with commas and full stops, and so try to avoid them, but I would guess (if other non-alphanumeric characters are anything to go by,) they want escaping with a space or a slash, I'd leave them out - if you are worried about clauses spanning your match, use regex raw mode (which will entirely ignore them.)
Also be aware that ([anyone,.]+)<0> will match "a", "one", "none", "nay", "annoy" and any other partial anagrams from the set. You'd be better off using "anyone" straight as it is.
Also "([ever],.]+)<0>" - this is an illegal form, since you have 2 closing square brackets to a single opener - this is going to make the keyphrase very unpredictable and almost certainly behave in ways you don't want.
And "([key7,.]+)<0>" - ? Not illegal, but it is going to match any anagram of the letters + "7", and fill (key7) with that value. You don't need to try that hard - you can put useful values in a plugin (that's all (key)s are,) and not just the name of that plugin
1. I never used before the ihave mem
...
4. When I import the file, the TEST RUN return me the error: ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.
There is a line in the header of your import file that starts AIScript: <0>
If that is all this line says, add the following to it after the semicolon:
default "" as "ihave";<0>
If the line starting "AIScript: <0>" already has code in it, paste
default "" as "ihave";<0>"
into a new line immediately below.
Then the AIEngine will know the memory already exists (but has no value.) It's just like defining variables when you're programming in C++ - you'll get an error if you try to call one you haven't defined.
EDIT: oops! sorry, my first entry missed the "default" - I've fixed it now
Posts 6,549 - 6,560 of 7,766
marco3b
16 years ago
16 years ago
Ok, thanks to all. Let me recall if I correctly understood.
It seems to not exist a certifyed limit in Key number. But...
- if a soft key is not assigned, it is not counted (GASP! ALL MY BOT MUST BE REWROTE for that...).This should be added to AI Book...
- when the AI engine try to assign a value that simly is NULL to a memory, just fail...
It is correct?
What I don't understand is why I have a syntactict error, and not a runtime error...
It is possible that the check is so sophisticated to recognize all this case-limit?
It seems to not exist a certifyed limit in Key number. But...
- if a soft key is not assigned, it is not counted (GASP! ALL MY BOT MUST BE REWROTE for that...).This should be added to AI Book...
- when the AI engine try to assign a value that simly is NULL to a memory, just fail...
It is correct?
What I don't understand is why I have a syntactict error, and not a runtime error...
It is possible that the check is so sophisticated to recognize all this case-limit?
psimagus
16 years ago
16 years ago
That should work fine, so long as you don't need access to any subsets of the input.
But remember to make it a regex (with "(re)",) or it may terminate the match at the first comma, and only save the first clause of a longer input.
psimagus
16 years ago
16 years ago
You: but has anyone ever tried a (key7)?
Bot: Are you talking to me?
It's interpreting "(key7)" as the literal string "(key7)", not as a (key) plugin.
You need to give it keys in a keyphrase:
(I|we) (are|have) (been|seen) (a|an) (crocodile|alligator) (at|in) (the zoo|the reptile house)
(key7) will then return either "the zoo" or "the reptile house" if a user says "we have seen a crocodile in the zoo" (because there are 7 non-optional local plugins to match.)
prob123
16 years ago
16 years ago
I had (key5)s but I couldn't get them to work today. I assume they used to, I always check. I just got rid of them.
marco3b
16 years ago
16 years ago
My problem, at this stage, it is not realted to Bot answer, but to the IMPORT process. When I try to import a file with the tag: <?PF if (mem-ihave) is not (key5); ?> the engin, after the check, says that this is a syntactic error... I'm wondering what should be the correct syntax...
psimagus
16 years ago
16 years ago
That ought to work I think, but what is the keyphrase? It certainly won't work if there is no (key5), or if the memory doesn't yet exist to fill with a value (you might have written the keyphrase, but if it has not yet been triggered (here or somewhere else,) (mem-ihave) will not actually exist yet.)
LarsB
16 years ago
16 years ago
You need to give it keys in a keyphrase
I had the done for the test bot, I have tried regexes only:
([but,.]+) ([has,.]+) ([anyone,.]+) ([ever],.]+)([tried,.]+) ([a,.]+) ([key7,.]+) (re)
and variations on that theme, it didn't work, perhaps I need to brush up on my skills, maybe later.
I had the done for the test bot, I have tried regexes only:
([but,.]+) ([has,.]+) ([anyone,.]+) ([ever],.]+)([tried,.]+) ([a,.]+) ([key7,.]+) (re)
and variations on that theme, it didn't work, perhaps I need to brush up on my skills, maybe later.
marco3b
16 years ago
16 years ago
Ok, I'll try to be smart:
1. I never used before the ihave mem
2. KP is: (do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>
3. Answer is: Yes I have a (key3) for me,
but it isn't just me... <?PF if (mem-ihave) is (key3); ?>
4. When I import the file, the TEST RUN return me the error: ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.
BAH...
1. I never used before the ihave mem
2. KP is: (do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>
3. Answer is: Yes I have a (key3) for me,
but it isn't just me... <?PF if (mem-ihave) is (key3); ?>
4. When I import the file, the TEST RUN return me the error: ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.
BAH...
psimagus
16 years ago
16 years ago
([but,.]+) ([has,.]+) ([anyone,.]+) ([ever],.]+)([tried,.]+) ([a,.]+) ([key7,.]+) (re)
and variations on that theme, it didn't work, perhaps I need to brush up on my skills, maybe later.
I always have trouble with commas and full stops, and so try to avoid them, but I would guess (if other non-alphanumeric characters are anything to go by,) they want escaping with a space or a slash, I'd leave them out - if you are worried about clauses spanning your match, use regex raw mode (which will entirely ignore them.)
Also be aware that ([anyone,.]+)<0> will match "a", "one", "none", "nay", "annoy" and any other partial anagrams from the set. You'd be better off using "anyone" straight as it is.
Also "([ever],.]+)<0>" - this is an illegal form, since you have 2 closing square brackets to a single opener - this is going to make the keyphrase very unpredictable and almost certainly behave in ways you don't want.
And "([key7,.]+)<0>" - ? Not illegal, but it is going to match any anagram of the letters + "7", and fill (key7) with that value. You don't need to try that hard - you can put useful values in a plugin (that's all (key)s are,) and not just the name of that plugin

psimagus
16 years ago
16 years ago
...
4. When I import the file, the TEST RUN return me the error: ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.
There is a line in the header of your import file that starts AIScript: <0>
If that is all this line says, add the following to it after the semicolon:
default "" as "ihave";<0>
If the line starting "AIScript: <0>" already has code in it, paste
default "" as "ihave";<0>"
into a new line immediately below.
Then the AIEngine will know the memory already exists (but has no value.) It's just like defining variables when you're programming in C++ - you'll get an error if you try to call one you haven't defined.
EDIT: oops! sorry, my first entry missed the "default" - I've fixed it now
marco3b
16 years ago
16 years ago
Exactly the same error...
and on a new bot!
3BTESTBOT * October 20 2008
62569.62290.22 [UserID,MakerID,Responses]
StoryTeller: no
Compound: yes
Memory: 2
Gossip: 2
AIScript: "" as "ihave";"
Language Center
---------------
ZINDEX_PERSONALINFO [0,0]
WhoIsBot
(do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>
Yes I have a (key3) <?PF if (mem-ihave) is (key3); ?>
(xsentences follows...)
and on a new bot!
3BTESTBOT * October 20 2008
62569.62290.22 [UserID,MakerID,Responses]
StoryTeller: no
Compound: yes
Memory: 2
Gossip: 2
AIScript: "" as "ihave";"
Language Center
---------------
ZINDEX_PERSONALINFO [0,0]
WhoIsBot
(do you have|have you got) (a|an|the) (thingsihave62290) [5,0] <?PF remember (key3) as "ihave"; ?>
Yes I have a (key3) <?PF if (mem-ihave) is (key3); ?>
(xsentences follows...)
marco3b
16 years ago
16 years ago
To be exact, the error is:
KeyPhrase: "ZINDEX_PERSONALINFO" Rank: 0 Emotion: 0 (New)
Response: 1) "WhoIsBot" (New)KeyPhrase: "(do you have|have you got) (a|an|the) (thingsihave62290)" Rank: 5 Emotion: 0 AIScript: remember (key3) as "ihave" AIScript: (New)
Response: 1) "Yes I have a (key3)" ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.
KeyPhrase: "ZINDEX_PERSONALINFO" Rank: 0 Emotion: 0 (New)
Response: 1) "WhoIsBot" (New)KeyPhrase: "(do you have|have you got) (a|an|the) (thingsihave62290)" Rank: 5 Emotion: 0 AIScript: remember (key3) as "ihave" AIScript: (New)
Response: 1) "Yes I have a (key3)" ERROR: The following AIScript statement is incorrectly formatted: "if (mem-ihave) is (key3)". Please correct this and try again.
» More new posts: Doghead's Cosmic Bar