-1

I just deployed the Watson Conversation plugin on Wordpress and its working very well - I can talk to Watson and he works just as he does in Bluemix.

However, I have no way to then see or manage the conversation history (aside from going into Bluemix).

The WP plugin has the api.php and app.js and I know one of these must at some point handle the text that the user inputs and Watson responds.

Does anyone know how I could save that conversation into my WP mySQL database, so I can analyze and work with it?

Thank you!

Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53

1 Answers1

0

If this plugin is using Nodejs (because of app.js) you need to create one custom code for it. Probably, the app.js have the call for the Conversation Service.

If this is your case...

You need to access the Log from Conversation service and get the return, and after it, save inside one MySQL database.

Using the plugin mysql inside the app.js if the lib Watson-Developer-Cloud is inside the code. And access the Logs with getLogs function. Where the Conversationv1 is the call for this service.

For use the mysql lib, please follow the 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 really recommend this project for you know the follow steps. In this case, the call for conversation service is the conversation variable, and for access the return, like entities, context varibles, etc, you will use the data return.

For example:

data.context.contextVariableInsideWatson

Official reference from IBM Developers: watson-developer-cloud/node-sdk Repository with one simple project using Conversation from IBM Developers here.

Sayuri Mizuguchi
  • 5,250
  • 3
  • 26
  • 53