Giter Site home page Giter Site logo

Comments (5)

germanattanasio avatar germanattanasio commented on May 18, 2024

Can you please elaborate your question? Maybe with an example.

from botkit-middleware.

sayurimizuguchi avatar sayurimizuguchi commented on May 18, 2024

Ex:

variable ("comando", "cmd");
function (message, conversationResponse, callback) { 
  if(conversationResponse.context.flag) {
    // Call your service here. 
    postOrder(["cmd comando", "comando"]); } 
    callback(null, conversationResponse);
  }
}

from botkit-middleware.

jersonjunior avatar jersonjunior commented on May 18, 2024

I have the same question, after the user enters something like pizza then in running the script as shown below:

var sys = require('sys');
var exec = require('child_process').exec;

function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("date > /root/date.txt", puts);

According to the subject #13 must use context flag in the dialog but do not know how to do it. Could you give practical examples of how this can be

from botkit-middleware.

sayurimizuguchi avatar sayurimizuguchi commented on May 18, 2024

I want developer one page for integration with Watson and conversation with users

Example:

//variables Watson
{
  "intents": [],
  "entities": [],
  "input": {},

// questions in conversation
"output": {
    "log_messages": [],
    "text": [
      "Olรก, posso ajudar em algo? "
    ],
    "nodes_visited": [
      "nodexxxx"
    ]
  },

//id conversation for integrate
  "context": {
    "conversation_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "system": {
      "dialog_stack": [
        "root"
      ],
      "dialog_turn_counter": 1,
      "dialog_request_counter": 1
    },
    "default_counter": 0
  }
}

// ADD MUST Take JSON
var pizza = output.text; 

// after the watson say idk

"output": {
    "log_messages": [],
    "text": [
      "Qual sabor da sua pizza? "

// ADD MUST Take JSON

var sabor = output.text; 

// after this, the watson reconigze the taste pizza and execute one command for request the pizza, example:


middleware.after = function(message, conversationResponse, callback) {
if(conversationResponse.context.flag){

 // Call your service here. 

postOrder(["juice", "pizza"]); 
} 
callback(null, conversationResponse); }

from botkit-middleware.

stevenoh93 avatar stevenoh93 commented on May 18, 2024

@jersonjunior You can follow this documentation to learn more about context variables. In short, you can use the tooling to easily set boolean flags in the context variable

@sayurimizuguchi I'm not sure if I am understanding your question, but I think you can also benefit from reading the documentation that I linked above on manipulating context variables

from botkit-middleware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.