AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

AIML Variables
 
 

The following category works

<category>  
           <
patternLOAD WAREHOUSE </pattern>  
           <
template>  
           <
think>  
           <
set name="warehouse">  
                                                       
Oranges  
           
</set>  
           </
think>  
           </
template>  
</
category

 
The following category produces: “Bot: Warehouse = Oranges”

<category>  
           <
patternGET11 </pattern>  
           <
template>  
                                 
Warehouse = <get name="warehouse"/>  
           </
template>  
</
category

How do I make “warehouse” an array?  And how might I address it?

(psuedo)
<
set name="warehouse"[1]>  Oranges </set>  
<
set name="warehouse"[2]>  Eggs </set>  


<
category>  
           <
patternGET11 </pattern>  
           <
template>  
                                 
Warehouse = <get name="warehouse[1]"/> 

Thanks Brian

 

 
  [ # 1 ]

With difficulty I would think:

<category
        <
pattern>LOAD WAREHOUSE </pattern
        <
template
        <
think
        <
set name="warehouse1">Oranges</set>
        <
set name="warehouse2">Eggs</set>
        </
think
        </
template
</
category>  

<
category
        <
pattern>GET1 </pattern
        <
template
                      
Warehouse = <get name="warehouse1"/> 
        </
template
</
category>  

<
category
        <
pattern>GET2 </pattern
        <
template
                      
Warehouse = <get name="warehouse2"/> 
        </
template
</
category
 

 
  [ # 2 ]

Hi Brian,

Welcome to the Chatbots.org forums! For your convenience, I have added some [ code ] and [/ code] tags in your posting (without the space within the tag, but I couldn’t enter that because then it would interpret it as tags). Anyway, using the tags makes your posting more easy to read. The next time, you can simply use the ‘code’ button or type the tags manually (through your keyboard. wink )

Thanks for adding your (not sure whether this is the right word) ‘stimulant’ bio. Why don’t you add a photo of yourself to complete your profile? Makes it more personal and the more likely people will respond.

Erwin

 

 
  [ # 3 ]

Thanks for the replies, I’m sure I’ll have many more of these type questions.  One complaint I have with the AIML community is a lack of documentation.  I’ve downloaded Program-0 and began to experiment.  I take it from the code Steve posted, I am allowed to create multiple variables (I think bot people like to call them predicates).  I’ve created 3 variables, but only able to get one of the three working.  The thought has crossed my mind that I was possibly allowed only one variable. 

This leads me to a role of “documenter”.  Not that I am a self proclaimed documentation guru, but I’ve not been able to find this type of documentation.  My belief is that one shouldn’t be just a complainer, so I’m documenting my discoveries about AIML in an html format.  One other general question I have, possibly a new thread in a different place…..

When attempting to give a bot more conversational depth, is this done within AIML or by making additions to the interpreter?

P.S. I don’t currently have a photo of myself to post online, but I would post one ASAP.
Thanks Brian

 

 
  [ # 4 ]

I’m not certain if you’re aware of it, Brian, but there’s a forum out there that is specifically for support of the Program O script. I’m fairly active there, since Morti uses a modified version of Program O, and I’m the person who usually handles the bulk of support questions there. You can find the forums at http://programo.smfforfree.com/index.php.

You can create the “illusion” of conversational depth within AIML through extensive use of topics. This allows for different answers to different inputs, based on the current topic at hand. I’ve posted about this in several other forums, but for the life of me, I can’t find my notes. I’ll look into the locations of these posts, and provide links for them later this evening.

 

 
  [ # 5 ]

Thanks Dave, sounds like just what I’m after.  I first went to the Program-O forum, but couldn’t get anywhere with it.  I’ve registered several times, but every time I attempt a post it tells me I must first register.  Are cookies required?  I really think that would be the best place for me to start considering I’m using Program-O and especially if you’ve already looked into the direction I’m going. 

When I first log in, I do see “Welcome Brimis73”, but every page thereafter says “Welcome, Guest.  Please login or register.

Hopefully you can help me with that, and I do look forward to hearing more about AIML and conversational depth.  Thanks Brian

 

 
  [ # 6 ]

Unfortunately, I’m not an admin at the site, and Liz (Program O’s creator) has been M.I.A. for a while now. But I do know that the site does require cookies. I’ve experienced similar trouble on other sites, and I’ve found that clearing my cookies and trying again has proved successful in the past. Sometimes a corrupted cookie can cause all sorts of grief. smile

If you have questions regarding Program O specifically, I’ll do what I can to see that you get some sort of answer. Feel free to email me through chatbots.org, or through my Contact Page if you need to.

By the way, Steve (AKA SquareBear) is certainly more qualified to address questions about AIML. I can seem to “muddle through” with most things, but Steve is a master. smile

 

 
  [ # 7 ]

I don’t know about master red face

Yes you can create as many variables as you like in AIML. Let me revisit the code I gave and refine it. I have had an idea.

 

 
  [ # 8 ]

You could try this:

<category
        <
pattern>LOAD WAREHOUSE </pattern
        <
template
        <
think
        <
set name="warehouse1">Oranges</set>
        <
set name="warehouse2">Eggs</set>
        </
think
        </
template
</
category>  

<
category
        <
pattern>GET *</pattern
        <
template
        
Sorrynothing is stored in that value.
        </
template
</
category

<
category
        <
pattern>GET 1</pattern
        <
template
                      
Warehouse = <get name="warehouse1"/> 
        </
template
</
category>  

<
category
        <
pattern>GET 2</pattern
        <
template
                      
Warehouse = <get name="warehouse2"/> 
        </
template
</
category>  

<
category
        <
pattern>WHAT IS IN WAREHOUSE *</pattern
        <
template
        <
srai>get<star/></srai>
        </
template
</
category

This should give something like:

Human: What is in warehouse 1
Bot: Oranges
Human: What is in warehouse 2
Bot: Eggs
Human: What is in warehouse 33442
Bot: Sorry, nothing is stored in that value.

If you could give more details of what you are trying to achieve, I may be able to help further.

 

 
  [ # 9 ]

Thanks for all the replies, I seem to have it fixed for now.  Program-O uses MySQL database, the problem seemed to be corrupt records in the table.  I’ve dropped the table and re-created it, seems to have fixed the problem.  I’ll be back with other questions though.  Thanks again

 

 
  login or register to react