Giter VIP home page Giter VIP logo

assistant-simple's People

Contributors

aarora91 avatar adamkingit avatar ambercraig avatar andrewyuau avatar ashleylord8 avatar avigadmi avatar bellabie avatar darylf avatar dependabot[bot] avatar dgterry avatar doconnor78 avatar ehdsouza avatar germanattanasio avatar jeff-arn avatar jennysalgado avatar johnwcolby avatar jsstylos avatar mamoonraja avatar mitchmason avatar neal-merkl avatar nfriedly avatar noah-eigenfeld avatar oliver-i avatar rajat avatar rrberry avatar rvennam avatar sgregglives avatar sirspidey avatar sud-puth avatar ttlew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assistant-simple's Issues

Call some external service

How do I execute an internal script in the operating system when the user insert example: Play some music => after the echo of the genre like Jazz.

Using temporary storage.

I'm using simple-bot and my bot keeps restarting conversation rather continuing on the same one. Additionally, it would reply with dialog with given intents (such as #intent) and would ignore welcome and anything_else dialogs.

  • Tried run as administrator.

info: ** No persistent storage method specified! Data may be lost when process shuts down.
info: ** Setting up custom handlers for processing Slack messages
info: ** API CALL: https://slack.com/api/rtm.start
Client server listening on port 5000
notice: ** BOT ID: test ...attempting to connect to RTM!
notice: RTM websocket opened
info: Slack message received
info: Warning: using temporary storage. Data will be lost when process restarts.
info: Slack message received
info: Warning: using temporary storage. Data will be lost when process restarts.
info: Slack message received
info: Slack message received
info: Warning: using temporary storage. Data will be lost when process restarts.
info: Warning: using temporary storage. Data will be lost when process restarts.
info: Slack message received
info: Warning: using temporary storage. Data will be lost when process restarts.
info: Slack message received
info: Warning: using temporary storage. Data will be lost when process restarts.
info: Slack message received
info: Warning: using temporary storage. Data will be lost when process restarts.
info: Slack message received
info: Warning: using temporary storage. Data will be lost when process restarts.
info: Slack message received
info: Warning: using temporary storage. Data will be lost when process restarts.

npm start fails

hi,

Application start fails with npm start with below error log.

[email protected] start c:\test
node server.js

c:\test\node_modules\watson-developer-cloud\lib\base_service.js:73
throw new Error('Argument error: username and password are required unless
use_unauthenticated is set');
^

Error: Argument error: username and password are required unless use_unauthentic
ated is set
at ConversationV1.BaseService.initCredentials (c:\test\node_modules\watson-d
eveloper-cloud\lib\base_service.js:73:13)
at ConversationV1.BaseService (c:\test\node_modules\watson-developer-cloud\l
ib\base_service.js:44:18)
at new ConversationV1 (c:\test\node_modules\watson-developer-cloud\conversat
ion\v1.js:31:15)
at Object. (c:\test\app.js:30:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the conversation-simple p
ackage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs conversation-simple
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls conversation-simple
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! c:\test\npm-debug.log

npm-debug.log is as below

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 silly lifecycle [email protected]
prestart: no script for prestart, continuing
7 info lifecycle [email protected]start: [email protected]
8 verbose lifecycle [email protected]
start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]start: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;c:\test\node_modules.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\nodejs;C:\Program Files\Cloud Foundry;C:\Users\Mohanish\AppData\Roaming\npm
10 verbose lifecycle [email protected]
start: CWD: c:\test
11 silly lifecycle [email protected]start: Args: [ '/d /s /c', 'node server.js' ]
12 silly lifecycle [email protected]
start: Returned: code: 1 signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: node server.js
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:886:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd c:\test
17 error Windows_NT 6.3.9600
18 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
19 error node v6.10.2
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error [email protected] start: node server.js
22 error Exit status 1
23 error Failed at the [email protected] start script 'node server.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the conversation-simple package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node server.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs conversation-simple
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls conversation-simple
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

npm start fails

Hi,

as per my issue reported earlier under issue#115
I had reported that npm start fails out.
The suggestions on that asked to change and rename .env file and to verify credentials.
I renamed the .env.example file to test.env and all values for Workplace ID, Conversation USername and conversation password are filled correctly. Blow is the error I am getting. Please if you can help

c:\test>npm start

[email protected] start c:\test
node server.js

c:\test\node_modules\watson-developer-cloud\lib\base_service.js:73
throw new Error('Argument error: username and password are required unless
use_unauthenticated is set');
^

Error: Argument error: username and password are required unless use_unauthentic
ated is set
at ConversationV1.BaseService.initCredentials (c:\test\node_modules\watson-d
eveloper-cloud\lib\base_service.js:73:13)
at ConversationV1.BaseService (c:\test\node_modules\watson-developer-cloud\l
ib\base_service.js:44:18)
at new ConversationV1 (c:\test\node_modules\watson-developer-cloud\conversat
ion\v1.js:31:15)
at Object. (c:\test\app.js:30:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v6.10.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the conversation-simple p
ackage,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs conversation-simple
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls conversation-simple
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! c:\test\npm-debug.log

Documentation in conversation.js vs payload.js

The ConversationPanel module is designed to handle all display and behaviors of the conversation column of the app.
https://github.com/watson-developer-cloud/conversation-simple/blob/dee3a25d7a47e994c248c4b01129867f9c2fd97d/public/js/conversation.js#L2

The PayloadPanel module is designed to handle all display and behaviors of the conversation column of the app.
https://github.com/watson-developer-cloud/conversation-simple/blob/6768bd937157011676591bb515f027a6fc047825/public/js/payload.js#L2

How is it that both "Panels" handle all display and behaviors of the conversation column?

Please be more descriptive regarding roles and responsibilities of the two Panels.

csv file does not import in tool

The tutorial for the Watson Conversation service asks to import a csv file car_intents.csv into the conversation tooling. I can't manage import : is there something wrong with the format ?

Confidence

In app.js updateMessage method, I noticed that confidence is not checked properly.

if ( !response.output ) {
    response.output = {};
  } else {
    if ( logs ) {
      // If the logs db is set, then we want to record all input and responses
      id = uuid.v4();
      logs.insert( {'_id': id, 'request': input, 'response': response, 'time': new Date()});
    }

    return response;
  }
  if ( response.intents && response.intents[0] ) {
    var intent = response.intents[0];
    // Depending on the confidence of the response the app can return different messages.
    // The confidence will vary depending on how well the system is trained. The service will always try to assign
    // a class/intent to the input. If the confidence is low, then it suggests the service is unsure of the
    // user's intent . In these cases, it is usually best to return a disambiguation message
    // ('I did not understand your intent, please rephrase your question,' etc..)
    if ( intent.confidence >= 0.75 ) {
      responseText = 'I understood your intent was ' + intent.intent;
    } else if ( intent.confidence >= 0.5 ) {
      responseText = 'I think your intent was ' + intent.intent;
    } else {
      responseText = 'I did not understand your intent';
    }
  }

If there is an output in the response confidence is not checked. I noticed that even if I give random sentence, I am getting some random output.

Watson respondes + Value

If i want add one variable with the message, what I do?

var test = 2222;

var latestResponse = Api.getResponsePayload();
var context = latestResponse.context;
Api.setResponsePayload('{"output": {"text": ["Hi Sayuri!"]},"context" : ' + JSON.stringify(test) +'}');

npm start does nothing

hi,
so I did everything as described and it's not working out. npm install seems to work fine. npm start shows me this:
screen shot 2017-05-05 at 21 32 27

and it just stops there. and my app is therefor empty (local and on bluemix of course)

can you help me?

Increment version_date

It would be helpful to increment the version_date.

I was using this application to reference the JSON output, but the changes to dialog_stack are not reflected because the version_date is set to 2016-09-20.

More function's inside app.js

Hello! I would like to add functions in the app.js file so that if someone tries to view the codes, they can not. But these functions will be used, for example:

var outputTeste = 2
var latestResponse = Api.getResponsePayload();
console.log(latestResponse);
var context = latestResponse.context;
`Api.setResponsePayload('{"output": {"text": ["Hi Sayuri: ",'+ outputTest + ']},"context" : ' + JSON.stringify(context) +'}');`

I try input my code inside app.js but show me error (Api is not defined).
In the case, What I do for insert function's inside one JS file, but, no one can see?
Can be in another js file, no problem.

Obs.: Before I put these functions inside Index.html, but it's not the best practice on security issues, right?

Error in App.js Code

In app.js Line 43 should be: if (!workspace || workspace !== '') {

Right now its: if (!workspace || workspace == '') Its super easy to miss it

Documentation mismatch

Great work here! However, it seems maybe the UI and things have changed so I'm not able to follow some of the steps mentioned. Can you please help?
So:

On the Service Details page, click Launch tool.

Click the Import workspace icon in the Conversation service tool. Specify the location of the workspace JSON file in your local copy of the app project:

<project_root>/training/car_workspace.json

Select Everything (Intents, Entities, and Dialog) and then click Import. The car dashboard workspace is created.

I don't see this Import workspace, I'm guessing it's just the Download json option., but what is meant by "click Import". I'm trying to embed this app with my own conversation bot in another html page.
Or can I replace the training/car-wordspace.json with my json file from my app, which is already running?

unable to install and start the app locally

Install the demo app package into the local Node.js runtime environment:

  1. npm install
    Start the app:
    2)npm start
    3)Point your browser to http://localhost:3000 to try out the app.

Followed the above instruction but was unable to install or start. I am new to this.
Can anyone plz say what should i type after npm install _________
and similarly npm start______

Error: spawn node-gyp ENOENT

I have followed instructions but i keep getting this error:

on compile Error: spawn node-gyp ENOENT
 at exports._errnoException (util.js:1026:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
  spawnargs: [ 'rebuild' ] }
[execSync v1.0.2]
    Native code compile failed!!

and when i try to run  i get this error


 [email protected] start C:\conversation-simple-master
> node server.js

C:\conversation-simple-master\node_modules\watson-developer-cloud\lib\base_service.js:78
        throw new Error('Argument error: username and password are required unless use_unauthenticated is set');
        ^

Error: Argument error: username and password are required unless use_unauthenticated is set
    at ConversationV1.BaseService.initCredentials (C:\conversation-simple-master\node_modules\watson-developer-cloud\lib\base_service.js:78:15)
    at ConversationV1.BaseService (C:\conversation-simple-master\node_modules\watson-developer-cloud\lib\base_service.js:45:18)
    at new ConversationV1 (C:\conversation-simple-master\node_modules\watson-developer-cloud\conversation\v1.js:30:15)
    at Object.<anonymous> (C:\conversation-simple-master\app.js:48:20)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the conversation-simple package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs conversation-simple
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls conversation-simple
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\conversation-simple-master\npm-debug.log

I am not sure why this is happening. What should i name my env file as? maybe that is the problem?

I get a blank page

Hi,
I've followed all steps very carefully, but I get a blank page with no watson response.
The error is here (app.js).

// Send the input to the conversation service
  conversation.message(payload, function(err, data) {
    if (err) {
      return res.status(err.code || 500).json(err);
    }`

I've tripled check the .env variables are ok, I've also tried to have directly in the code. No changes.
Can you help ?

npm start error pointing to issue with conversation-simple package

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: `node server.js`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack     at EventEmitter.emit (events.js:110:17)
9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at ChildProcess.emit (events.js:110:17)
9 verbose stack     at maybeClose (child_process.js:1015:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid [email protected]
11 verbose cwd /Users/adithyanayabu1/Documents/Technology-Learn/ChatBots/virtual-ta-chatbot
12 error Darwin 16.1.0
13 error argv "node" "/usr/local/bin/npm" "start"
14 error node v0.12.7
15 error npm  v2.11.3
16 error code ELIFECYCLE
17 error [email protected] start: `node server.js`
17 error Exit status 1
18 error Failed at the [email protected] start script 'node server.js'.
18 error This is most likely a problem with the conversation-simple package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     node server.js
18 error You can get their info via:
18 error     npm owner ls conversation-simple
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
 

getting nmp error in terminal

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 silly lifecycle [email protected]
prestart: no script for prestart, continuing
7 info lifecycle [email protected]start: [email protected]
8 verbose lifecycle [email protected]
start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Tumasov/Documents/Builder/Car ChatBot/conversation-simple-master/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle [email protected]
start: CWD: /Users/Tumasov/Documents/Builder/Car ChatBot/conversation-simple-master
11 silly lifecycle [email protected]start: Args: [ '-c', 'node server.js' ]
12 silly lifecycle [email protected]
start: Returned: code: 1 signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: node server.js
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:194:7)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:194:7)
14 verbose stack at maybeClose (internal/child_process.js:899:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd /Users/Tumasov/Documents/Builder/Car ChatBot/conversation-simple-master
17 error Darwin 16.4.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.7.4
20 error npm v4.1.2
21 error code ELIFECYCLE
22 error [email protected] start: node server.js
22 error Exit status 1
23 error Failed at the [email protected] start script 'node server.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the conversation-simple package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node server.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs conversation-simple
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls conversation-simple
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

Entities and Dialog

Hello,

I suppose you created Entities and a Dialog in your own Conversation Workspace to get not only the intents but realistic responses.
Did you document this part somewhere ?

Thank you in advance

Buttons?

I noticed your experiment with buttons adding them into the chat flow.

How is this achieved?

cf push - yaml: line 7: did not find expected key

Getting YAML: line 7: did not find the expected key issue when trying to push to bluemix.
Working fine in local

This is the content of my manifest.yml file

---
declared-services:
 Conversation-r7:
   label: conversation
   plan: free
applications:
- name: conversation-simple-app-test1
 command: npm start
 path: .
 memory: 256M
 instances: 1
 services:
 - Conversation-r7
 env:
   NPM_CONFIG_PRODUCTION: false

Conversation-r7 is the service name. Have also run

cf create-service-key Conversation-r7 myKey

to create a key as described. It's working fine in local

POST 401 error - "/api/message"

Hi,

I receive this error message in the console:
"POST /api/message 401 (Unauthorized)"

  1. I installed all the dependencies
  2. I renamed the file .env.example to .env and I added my credentials
  3. npm start
$ npm start

> [email protected] start C:\Users\Marian\Desktop\Work\Watson\conversation-simple
> node server.js

Server running on port: 3000

http://localhost:3000/api/message 401 (Unauthorized)

image

... I guess I have to use Cloud Foundry CLI to log in Bluemix.


๐Ÿฅ‡ Configurations and fancy terms everywhere...

Answer found for configuration(Cloud Foundry CLI and Bluemix login), but 401 error still apears :
https://console.ng.bluemix.net/docs/cli/reference/cfcommands/index.html#cf_login
https://developer.ibm.com/answers/questions/167039/organization-not-found-when-establish-connection-v.html
https://console.eu-de.bluemix.net

No credentials sent

I am trying to connect my node.js app (cloned from github: https://github.com/watson-developer-cloud/conversation-simple
I supplied my workspace id, username and password in the .env file and when running npm start and navigating to localhost:3000 I just see the interface but when I send a message I get no response and a statuscode 401: Failed to load resource: the server responded with a status of 401 (Unauthorized)

I tried logging in by using cf login -a https://gateway-fra.watsonplatform.net/conversation/api -u username -p password
and I get the same error.

Can you please help me connecting my app correctly to my conversation service?

Locally conversation-simple

Hi.
Can someone said where and how to set .env file as describe on the manual. Can someone give a example please?

Example: Watson Responds.

I know if I want send any to Watson in conversation I use the:

var latestResponse = Api.getResponsePayload();
var context = latestResponse.context;
Api.sendRequest("Hi Watson!", context);

I want to know how do I get Watson to send something in the conversation. I saw some examples and tried and it did not work. Can someone help?

I dont now If I'm doing right, but My example is:

// var responseText = null;
   //responseText = {};
 var latestResponse = Api.setResponsePayload(); // I dont know if this is true
  var context = latestResponse.context;
  Api.sendRequest('Hi Sayuri!', context); // I try this
  responseText = 'Hi Sayuri!' , context; // I try this too

Master branch is not working on deploying it to bluemix

I am working with IBM India and tried to pull the code to build a conversational application. I checked out code from master branch and fowed all the instructions to modify .env file and manifest.yml while. App is built locally and running perfectly fine.

But when I deployed same app to Bluemix, App is deployed properly. Though front end is appearing but dialogue services are not working. Please note code was checked out from master.

Then I checked out code from previous branch "update-readme-rrberry" and modified it's .env and manifest on deploying this code to Bluemix it's working properly.

On inspecting the code the following changes in SDK are causing problem and not allowing app to integrate with conversation services:

f2447db

Then I took the code from master branch and reverted changes for this commit and re-deployed the app to Bluemix. App is working properly and running on bluemix.

There is some issue with SDK changes. Please review.

Testing the app locally

Hi
I am creating an app using the conversation-simple as a boilerplate. I have setup the app to use my own conversation instance, and it works beautifully - so thanks for that :-)

However, I cannot run the app locally. That is, when I do it doesn't use my conversation instance, but only shows the empty interface. The console shows an unauthorized error.

I hope someone can help me with this, since pushing the app to bluemix every time I need to see a change is really time consuming! ๐Ÿ‘Ž

Bonus question: I am trying to modify the response from watson on the client side, in the method "updateMessage". I am checking if the intent matches a specific string, and if it does I update the response that is returned. But nothing seems to override the response from the server.

Error .env.example

Hi,
I try get the info of my IBM bluemix, but dont work (locally).
In the ibm bluemix I have to add the WORKSPACE_ID to work in "Environment Variables".
What am I doing wrong?
Obs.: In the Conversation-enhanced I get the info and work, But in this one I must be doing something wrong, can it help?

Print:
capturar

Print 2:
2

New Image is not showing

Hi,
I deployed your sample on bluemix and now I and trying to change the graphics. I changed the car dashboard image for a airplane dashboard image using the same name. I built and deployed the app and the image changes does not appear it still show the car dashboard. Please advice

How to update the context?

Hi guys, how you doing?

First sorry for my noobie question.
It's possible to update the context object in app.js requesting conversation.message() function? I need update my context with the variable value returned from my backend and use it in Conversation node.

Thanks and best regards,
Vinicius

how to do something in a part of conversation

How to perform some function but, if only get a part of the conversation with X intent and X entity?
I had one example with intent and entity, what I need is:

Example:
I have one context variable and this get the value.
Watson: Hi, what's your name?
User: Sayuri
Watson: Hi $name! //Sayuri in the case

And, after user said your name, I will execute something

I need one example with "if'. I confused with conversation flows, because I dont know how to do it because the "dialog_turn_counter": 2 is a array, right?

if (context.name[2] !== 'undefined') {
 // do something
}

How access context variables from app.js

Hi, good afternoon,
in the case I want to knows how I create one function for access the context variables inside app.js.
I does not use the updateMessage, i want create other just for access and do something after.
In the case updateMessage Is a function in realtime? right?

Example currently:

var payload = {
    workspace_id: workspace,
    context: {},
    input: {}
  };
  if ( req.body ) {
    if ( req.body.input ) {
      payload.input = req.body.input;
    }
    if ( req.body.context ) {
      // The client must maintain context/state
      payload.context = req.body.context;
    }
  }
  // Send the input to the conversation service
  conversation.message( payload, function(err, data) {
    if ( err ) {
      return res.status( err.code || 500 ).json( err );
    }
    updateMessage( res, payload, data );
    
 
  } );
} );

/**
 * Updates the response text using the intent confidence
 * @param  {Object} res The node.js http response object
 * @param  {Object} input The request to the Conversation service
 * @param  {Object} response The response from the Conversation service
 * @return {Object}          The response with the updated message
 */
function updateMessage(res, input, response) {
   if (response.context.mail == 'some mail') {
    doThis(); 
   console.log('works fine');
  }

Thank u

node install.js not found

ubuntu 16
I am getting this error, it seems like this file is missing. Wont allow me to install.
note: i got this to work before on another OS but i had to re-install it
[email protected] install /home/hb/Desktop/conversation-simple-master/node_modules/execSync

node install.js

sh: 1: node: not found
[email protected] /home/hb/Desktop/conversation-simple-master

ubuntu 14

3615 verbose about to build /home/hb/Desktop/conversation-simple-master/node_modules/codecov/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror
3616 info build /home/hb/Desktop/conversation-simple-master/node_modules/codecov/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror
3617 verbose linkStuff [ false,
3617 verbose linkStuff false,
3617 verbose linkStuff false,
3617 verbose linkStuff '/home/hb/Desktop/conversation-simple-master/node_modules/codecov/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules' ]
3618 info linkStuff [email protected]
3619 verbose linkBins [email protected]
3620 verbose linkMans [email protected]
3621 verbose rebuildBundles [email protected]
3622 info install [email protected]
3623 info postinstall [email protected]
3624 error weird error 127
3625 verbose exit [ 1, true ]
3626 error Error: ENOENT, lstat '/home/hb/Desktop/conversation-simple-master/node_modules/codecov/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml'
3627 error If you need help, you may report this log at:
3627 error http://github.com/isaacs/npm/issues
3627 error or email it to:
3627 error [email protected]
3628 error System Linux 4.2.0-42-generic
3629 error command "/usr/bin/nodejs" "/usr/bin/npm" "install"
3630 error cwd /home/hb/Desktop/conversation-simple-master
3631 error node -v v0.10.25
3632 error npm -v 1.3.10
3633 error path /home/hb/Desktop/conversation-simple-master/node_modules/codecov/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml
3634 error fstream_path /home/hb/Desktop/conversation-simple-master/node_modules/codecov/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml
3635 error fstream_type File
3636 error fstream_class FileWriter
3637 error code ENOENT
3638 error errno 34
3639 error fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:284:26
3639 error fstream_stack Object.oncomplete (fs.js:107:15)
3640 verbose exit [ 34, true ]

Simple conversation deployed but "Watson does not understand"

Hello ,
I have followed the deployment steps of the simple conversation app on Bluemix.
I notice :
-that the Service has to be created manually (only the app is deployed)
-after importing the car_workspace.json file, I get a workspace id and can add the user defined variable.
I get the introduction to the dialog : Hi. It looks like a nice drive today. What would you like me to do?
However , the system does not recognize any sentence at all (keeps answering : I'm not sure about that. You can say things like "Turn on my lights" or "Play some music.")
Is there something I am missing ?
Thanks for your help

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.