Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ConversationV1 = require('watson-developer-cloud/conversation/v1');
- // Set up Conversation service wrapper.
- var conversation = new ConversationV1({
- username: '4d1076d1-1c64-4ac8-8f4d-a12d8d4df9e6', // replace with username from service key
- password: 'eKCHLmglT3Mz', // replace with password from service key
- path: { workspace_id: 'b4bb901d-63fa-4149-b5d8-82acd9ca94ba' }, // replace with workspace ID
- version_date: '2016-07-11'
- });
- var resp = "";
- // Process the conversation response.
- function processResponse(err, response) {
- if (err) {
- console.error(err); // something went wrong
- return;
- }
- // Display the output from dialog, if any.
- if (response.output.text.length != 0) {
- //maybe set response.output.text as output or returned?
- console.log(response.output.text[0]);
- resp = response.output.text[0];
- }
- }
- //change user input here
- var userInput = "help create";
- conversation.message({input:{ text: userInput }}, processResponse);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement