javascript - How to save Watson Conversation history in my mySQL database? -
i deployed watson conversation plugin on wordpress , working - can talk watson , works in bluemix.
however, have no way see or manage conversation history (aside going bluemix).
the wp plugin has api.php , app.js , know 1 of these must @ point handle text user inputs , watson responds.
does know how save conversation wp mysql database, can analyze , work it?
thank you!
if plugin using nodejs (because of app.js
) need create 1 custom code it. probably, app.js
have call conversation service.
if case...
you need access log conversation service , return, , after it, save inside 1 mysql database.
using plugin mysql
inside app.js if lib watson-developer-cloud inside code. , access logs getlogs function. conversationv1
call service.
for use mysql lib, please follow example code:
var mysql = require('mysql'); var connmysql = function(){ return mysql.createconnection({ host: 'localhost', user: 'youruser', password: 'yourpassword', database: 'namedatabase' }); } module.exports = function (){ return connmysql; }
i recommend this project know follow steps. in case, call conversation service conversation
variable, , access return, entities
, context
varibles, etc, use data
return.
for example:
data.context.contextvariableinsidewatson
official reference ibm developers: watson-developer-cloud/node-sdk repository 1 simple project using conversation ibm developers here.
Comments
Post a Comment