Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation ends abruptly.... #90

Closed
jjdepaul opened this issue Aug 29, 2017 · 2 comments
Closed

Conversation ends abruptly.... #90

jjdepaul opened this issue Aug 29, 2017 · 2 comments
Labels

Comments

@jjdepaul
Copy link

I'm using these in my sample work:
"botkit": "^0.5.8",
"botkit-middleware-watson": "^1.4.0"

My conversation is very simple, it asks three questions of the user to collect enough data to run a query. The conversation starts fine, goes to the Billing branch and then to the Aggregate branch just like it should, but then it falls out to 'Anything Else' instead of staying in the conversation path to the end - please see attached diagram below.

My agent code is down below. Please advise what is missing, I can see the conversation counter advancing each time.... why does the conversation end abruptly?

conversation ends abruptly

Here is my agent code:

require('dotenv').load();

var Botkit = require('botkit');
var express = require('express');

// Configure your bot.
var slackController = Botkit.slackbot();
var slackBot = slackController.spawn({
  token: process.env.SLACK_TOKEN
});

// Create the middleware object - for connecting with conv.
var watsonMiddleware = require('botkit-middleware-watson')({
  username: process.env.CONVERSATION_USERNAME,
  password: process.env.CONVERSATION_PASSWORD,
  workspace_id: process.env.WORKSPACE_ID,
  url: process.env.CONVERSATION_URL || 'https://gateway.watsonplatform.net/conversation/api',
  version_date: '2017-05-26'
});

// This declares the watsonMiddleware as the handler for the receive method
slackController.middleware.receive.use(watsonMiddleware.receive);


slackController.hears(['.*'], ['direct_message'], function(bot, message) {
  watsonMiddleware.interpret(bot, message, function() {
    if (message.watsonError) {
      bot.reply(message, "I'm sorry, but for technical reasons I can't respond to your message");
    } else {
      console.log("\nsprint-bot-slack.js > to the bot with message.context: " + JSON.stringify(message.watsonData.context, 2, null) + "\n");
      bot.reply(message, message.watsonData.output.text.join('\n'));
    }
  });
}); 

// Start the bot using Real Time Messaging APIs
slackBot.startRTM();
@Naktibalda
Copy link
Contributor

It is highly unlikely that this is an issue of Botkit Watson Middleware.
Most likely it is an issue of your dialogue.

Better places to ask such questions are:
https://developer.ibm.com/answers/topics/watson-conversation/
https://stackoverflow.com/questions/tagged/watson-conversation
http://wdc-slack-inviter.mybluemix.net/

Your screenshot makes an impression that Aggregate is the last node in the chain and the next message sent by the user triggers top level recognition again. It is a normal behaviour.
If you don't want to go back to beginning at the end of the chain, you have to change the action from Wait for user input to Jump to ...

@germanattanasio
Copy link
Contributor

Not a issue with this library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants