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,546 - 6,557 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
Posts 6,546 - 6,557 of 7,766
LarsB
16 years ago
16 years ago
Well, new things to be learned each day, I remember trying to get (key4) in AIscript to store as a memory about 18 months ago and it didn't seem to work, might have been my poorer understanding of the whole thing back then and never really thought about it again until marco3b mentioned and Psimagus explained it today.
LarsB
16 years ago
16 years ago
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?
You: but has anyone ever tried a (key7)?
Bot: Are you talking to me?
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

» More new posts: Doghead's Cosmic Bar