2

I found the bot.aiml file here, and it uses things such as <bot name="genus"/>. I assume this works similar to something like <get name="name"/>, which would get the client's name. So, how would I set properties such as genus for the bot, so that I can retrieve it this way?

Jacob Garby
  • 773
  • 7
  • 22

2 Answers2

1

Suppose the bot asks you your name and when you say "MY NAME IS JACOB", you want the bot to say "I WILL REMEMBER THAT YOUR NAME IS JACOB", and set the value of variable "clientname" to "JACOB".

Add these lines to your AIML file:

<category>
    <pattern>MY NAME IS *</pattern>
    <template>I will remember that your name is </star><think><set name="clientname"></star></set></template>
</category>

In this, </star> tag represents whatever you will enter in the place of * (JACOB in this case).

Sanket B
  • 1,070
  • 1
  • 9
  • 23
0

I think the original question is about the bot's properties, not about user properties.

In AIML v1 (and v2) bot properties are retrieved using <bot name="name"/> (for example) for getting the bot's name. User properties are retrieved using <get name="name"/> and are updated using <set name="name">Fred</set> (for example). I don't think standard AIML has any means for updating the bot's properties after the bot is loaded.

Ubercoder
  • 711
  • 8
  • 24
  • how to set the bot name? The normal way how we set the variable using set doesn't work – arqam Sep 05 '18 at 08:54
  • 1
    There is supposed to be a 'startup' file that defines all the bot properties. These properties are defined when the categories are loaded, and they can't be changed after being loaded (not in standard AIML anyway). – Ubercoder Sep 05 '18 at 10:43
  • But I could not find any resource which tells how this startup file is created and used. I have posted a stackoverflow question for this problem : https://stackoverflow.com/questions/52182049/setting-bot-properties-in-aiml – arqam Sep 05 '18 at 10:59
  • Unfortunately I'm not familiar with how the startup file is defined, I think it varies depending on the type of interpreter. But somewhere there will be a file, called something like setup.txt or similar. – Ubercoder Sep 05 '18 at 11:28
  • This is one of the famous aiml code in python : https://github.com/datenhahn/python-aiml-chatbot Can you please have a look, as I could not find any over here. – arqam Sep 05 '18 at 11:30