Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session-dependent variables not working? #10

Closed
JustArchi opened this issue Feb 2, 2017 · 11 comments
Closed

Session-dependent variables not working? #10

JustArchi opened this issue Feb 2, 2017 · 11 comments

Comments

@JustArchi
Copy link
Contributor

First of all, I'd like to say big thanks for everything you've done in Program Y - it works really awesome and built-in REST server is just marvelous. I was searching for AIML 2.0 interpreter that had some API for interaction, and this is exactly what I needed! ❤️

Now onto actual issue, I noticed that bot is not capable of remembering user-defined variables across a single session:

Hi, how can i help you today?
>>> what's my name
I don't know your name. what is your name?
>>> my name is Archi
ERROR:root:Global property already exists for name [name], ignoring set!
ERROR:root:Global property already exists for name [firstname], ignoring set!
What's up, archi.
>>> what's my name
I don't know your name. what is your name?

It looks like it wants to set global property instead of local one.

Also it'd be nice if bot didn't put everything in lower-case - some things like names have specific case that should be kept in-tact - that also affects global properties that are forced-lowercase when constructing a response.

Once again, thanks a lot for everything - this is a really well done project, and I hope it gets only better in future!

@keiffster
Copy link
Owner

2 problems I am aware of and working on, the first is a wrong assumption about where to store state, and it can be fixed either by using or wait for the next release which solves it ;-)

The second one is a carry over from my work on AIML 1 which would do everything in upper case, I then added a post processor ( see the postprocessor.txt file ) which converts everything to Sentence format. I need to remove this and then remember case of the orignal AIM content and let you as bot master choose which case via the and tags

@JustArchi
Copy link
Contributor Author

Oh, sorry, if you were aware of this then I only generated extra clutter 😅 . It's very nice to hear that you're working on this, as the entire project has lots of potential - I'll patiently look forward to all upcoming commits, thank you!

@maxjread
Copy link

maxjread commented Feb 3, 2017

Awesome work on this, thanks for sharing. My animatronic head is using AIML 1, but this will transform its intelligence once the little bugs are ironed out. Really looking forward to next release :-)

@newdev7
Copy link

newdev7 commented Feb 9, 2017

I'm also looking for the similar thing. I need to store the user details (not only name) in the session. In the middle of the conversation, if the user asks about their detail, it needs to answer. Even after using the for storing name, I'm not able to retrieve the name.

Also I want to ask one more question. In the .aiml file, CR tags are used inside the template tag. What is the purpose of this tag?

Thanks.

@keiffster
Copy link
Owner

its a known issue, and is related to session management. I'm working on a fix, and might release an interim shortly that fixes the issue for single instances of the bot, with a further release later that addresses the concept of true multi session management

@keiffster
Copy link
Owner

In terms of CR tag, not sure what you are referring to, can you give ma an example, is not a tag I implemented or is part of the aiml spec

K

@keiffster
Copy link
Owner

Update on Session Variables

So I've revisited the code and looked at what people are seeing, and I think the problem is lack of documentation !!

The variables name and firstname are not global variables, they are actually global constants, which are found in the predicates.txt. These are constants set up by the bot master and refer to the name and firstname of the bot and therefore cannot be used

So the error message is right and you have 2 choices

  1. Remove the name and firstname constants from predicates.txt
  2. Choose unique names for name and firstname which are unique to your bot and/or conversation

I have a number of tests which are checking session management and a nee upgrade which makes this easier to understand is coming soon

Hope this clarifies things

K

@JustArchi
Copy link
Contributor Author

It looks like you're right.

16:00 - Archi: I live in poland
16:01 - ArchiBoT: How do you like it there?
16:00 - Archi: where do I live
16:01 - ArchiBoT: You said it was POLAND ?
16:01 - Archi: correct
16:01 - ArchiBoT: Um.

That leads to another question - why setting name doesn't work, if it does work when rosie is being used in Pandorabots? We probably want to match original Pandorabots engine as much as possible if we want to target AIML 2.0, so it'd be a good idea to investigate this.

@keiffster
Copy link
Owner

Very true, and opens up an interesting debate. Is pandora actually AIML 2.0 compliant lol. Pandora implements a whole suite of additional tags, some of which are documented, some you find out when you write your own interpreter.

Don't get me wrong, I have huge respect for the Pandora guys, they really drive the architecture forward, you just have to hang on and work through the various deviations your find when you build it yourself.

My own personal preference is that predicates are constants are such and should remain so, but as you say Pandora allows you could change them, so it's possible to have the following conversation

Hello
Hello I am KeiffBot
Your name is Archi
OK I am Archie
What are you made from
I am written in Python
You are coded in Spaghetti
OK I am made from Spaghetti
Tell me about yourself
My name is Archie and I am made from Spaghetti

Part of me quite likes that, so I'm going to had a flag to the parser to state whether predicates are overridable then the bot master can decide if he wants a spaghetti monster!

K

@JustArchi
Copy link
Contributor Author

I know, what you did here is nothing less than a masterpiece, and I understand very well that it's not easy to create something that works exactly the same if major part of the specification is in fact undocumented and you have to "guess" how it works. This is why I'm only reporting what I'm able to find, so you can investigate this and decide yourself how you want to deal with this (and if at all). 👍

Overridable constants sound good, I most definitely can find usages of them, not to mention that it fixes the problem, so why not 👍

@newdev7
Copy link

newdev7 commented Feb 10, 2017

@keiffster No need to think about that CR tag. I'm using MacOS. I opened the .aiml file in TextMate. That CR tag is visible only in the TextMate. When I open the same file in the TextEdit, that tag is not visible. Sorry for the trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants