Simple restful api server, process request string (keyword) and return data base on AIML algorithm.
You can use this to create simple chatbot, understanding user queries and return value base on template / pattern of queries.
This project need Nodejs
and AIMLInterpreter
library to run. Install with npm
:
npm install aimlinterpreter
Edit test.aiml.xml
with aiml content. Learn more about AIML at http://www.alicebot.org/aiml.html
node server.js
By default, web server will start from port 8088
Request to url http://localhost:8088?q=YOUR_STRING&format=json|text
Query string meanings:
q
: Keyword will search in AIML file.format
: can bejson
ortext
.
-
Request to:
http://localhost:8088?q=hi&format=json
-
Sample response (
json
format):
{
"text": "Hello to you too",
"wildcard": []
}