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..

How do I get my bot to call a search engine with multiple search terms from within AIML
 
 

Hi all,

I finally have a working chat bot. I have incorporated program-AB as a library in a language called quorom. See https://quorumlanguage.com/ for more information.  My bot can receive basic questions and answer them. It is a domain specific bot on information security. I have created an AIML file that contains some of the questions but the bot does not know everything. If it does not know the answer, I want the bot to go to a search engine (I am thinking duckduckgo for now) and give whatever answer it finds. Once the robot gets the answer, I want it to log the question and the answer it has found. I then plan to review the log and manually add categories and answers for now. How do I get the bot to go to a search engine? Yes, I have seen the * wildcard but what happens if my user enters multiple terms? The <star> tag appears to only pick up the first word.
I am running the bot on a computer running windows. I may move it to Linux but I do not see it becoming a mobile phone application.

Pranav

 

 
  [ # 1 ]
<star index="1"/> = 1st wildcard
<star index="2"/> = 2nd wildcard
<star index="3"/> = 3rd wildcard

and so on.

<
star index="1"/> is the same as <star/>

SEARCH FOR *
will pick up as many words as the user enters and allocate that to <star index="1"/>


SEARCH FOR * *
will put the first word into <star index="1"/> and the rest into <star index="2"/> 

Excuse the code block but the forum kept trying to format my message.
Hope that helps.

 

 
  [ # 2 ]

Hi Steve,
Many thanks. I want the bot to go to duckduckgo when it cannot find the answer. This however is failing at the moment. See the below AIML snippet.
<category>
*</pattern>
<template><srai>SEARCH FOR *</srai></template>
</category>
<category>
SEARCH FOR *</pattern>
<template>
http://api.duckduckgo.com/?q=<star index=“1”>&format=json&pretty=1&no_html=1&t=cisobot
</template>
</category>

I will programmatically handle the bot’s output but need it to return the search result.

 

 
  [ # 3 ]

Hi again Steve,
My primary problem appears to be that I am unable to specify the URL in the <template> tag. Do I need to enclose the URL in another tag? Program-AB gives me the following error message
http://api.duckduckgo.com/?q=<star index=“1”>&format=json&pretty=1&no_html=1&t=cisobot
AIMLToCategories: org.xml.sax.SAXParseException; systemId: file:/D:/progs/chatter/resources/botdata/bots/ciso/aiml/ciso.aiml; lineNumber: 21; columnNumber: 39; The value of attribute “href” associated with an element type “a” must not contain the ‘<’ character.
My revised code is as follows.
<category>
SEARCH FOR *</pattern>
<template>
<a >&format=json&pretty=1&no_html=1&t=cisobot”></a>
</template>
</category>
I have seen references to using javascript but I do not want to do that. I am going to process the bot’s response and display it to the user.

 

 
  [ # 4 ]

Hi all,
To close this thread, I coded my bot to handle this situation. I had AIML display a standard response when it did not know the answer. I then pull that data from duckduckgo and displayed it if it is available; else the robot gives a standard response.

 

 
  [ # 5 ]

Sorry for not reply but good to see you got it sorted.

 

 
  login or register to react