Code Monkey home page Code Monkey logo

assistant-with-discovery-openwhisk's People

Contributors

cvsanchez42 avatar g-may avatar germanattanasio avatar jeff-arn avatar jotaraffalli avatar mamoonraja avatar

Stargazers

 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

assistant-with-discovery-openwhisk's Issues

Getting error during sh create-openwhisk-actions.sh

sh create-openwhisk-actions.sh
Creating OpenWhisk Actions...
error: Unable to create package 'assistant-with-discovery-openwhisk': resource already exists (code 0610bf7ca8d3da49e1c7c2312d573dbb)
error: Unable to create action 'assistant-with-discovery-openwhisk/conversation': resource already exists (code 9cf847df74b87f2532be469ab74af978)
Run 'wsk --help' for usage.
error: Unable to create action 'assistant-with-discovery-openwhisk/discovery': resource already exists (code e4b07b61398c97c93d9e2c7a9cf2cb01)
Run 'wsk --help' for usage.
Setting default parameters...
ok: updated action assistant-with-discovery-openwhisk/conversation
ok: updated action assistant-with-discovery-openwhisk/discovery
Creating OpenWhisk Sequence...
error: Unable to create action 'assistant-with-discovery-openwhisk/assistant-with-discovery-sequence': resource already exists (code 9ddd76fdd1d73ef1b40ac853495ef1b9)
Run 'wsk --help' for usage.
Retrieving OpenWhisk WebAction URL...

Error executing sh create-openwhisk-actions.sh

alexv@LAPTOP-FHN7KDT7 /cygdrive/c/Users/alexv/assistant-with-discovery-openwhisk-master
$ sh create-openwhisk-actions.sh
create-openwhisk-actions.sh: line 1: source: /usr/bin/env: cannot execute binary file
Creating OpenWhisk Actions...
error: Unable to create package 'assistant-with-discovery-openwhisk': resource already exists (code 3acc0aba5250971fd70d11a9da4c5a2b)
error: Unable to create action 'assistant-with-discovery-openwhisk/conversation': resource already exists (code f35fce403e0a50ddc019900b002f8200)
Run 'wsk --help' for usage.
error: Unable to create action 'assistant-with-discovery-openwhisk/discovery': resource already exists (code ef85a6158bc4a8a07d34648ffab815c4)
Run 'wsk --help' for usage.
Setting default parameters...
error: Failed to parse arguments: The parameter arguments are invalid: Arguments for '--param' must be a key/value pair
Run 'wsk --help' for usage.
error: Invalid argument(s). File 'collection_id' is not a valid file or it does not exist
Run 'wsk --help' for usage.
Creating OpenWhisk Sequence...
error: Unable to create action 'assistant-with-discovery-openwhisk/assistant-with-discovery-sequence': resource already exists (code e44c843d0378c24ab1e6c2cb463a320d)
Run 'wsk --help' for usage.
Retrieving OpenWhisk WebAction URL...

Failed during sh create-openwhisk-actions.sh

Hi, got this error while running sh create-openwhisk-actions.sh
create-openwhisk-actions.sh: line 1: source: .env: file not found
I do have an env file generated in the instructions before.

Problem to deploy on bluemix.

Hello Team.
I complied the sample successfully and can start it as development version
npm start
It works fine. It also works fine when I build it for production with
npm run build
and then start with
serve -s build
I had no problem also to deploy it on another host under Apache web server.

The problems start when I try to deploy to bluemix.

I have created manifest.yml file:
applications:

  • name: assistant-with-discovery-openwhisk
    random-route: true
    memory: 128M

and try to deploy it with
ibmcloud cf push

It looks to build successfully but fails to start:

Waiting for app to start...
Start unsuccessful

TIP: use 'cf logs assistant-with-discovery-openwhisk --recent' for more information
FAILED

In the logs I can see:

2019-02-26T15:36:29.95+0300 [CELL/0] OUT Starting health monitoring of container
2019-02-26T15:36:31.56+0300 [APP/PROC/WEB/0] OUT > @ibm-watson/[email protected] start /home/vcap/app
2019-02-26T15:36:31.56+0300 [APP/PROC/WEB/0] OUT > npm-run-all -p watch-css start-js
2019-02-26T15:36:33.76+0300 [APP/PROC/WEB/0] OUT > @ibm-watson/[email protected] start-js /home/vcap/app
2019-02-26T15:36:33.76+0300 [APP/PROC/WEB/0] OUT > react-scripts start
2019-02-26T15:36:33.77+0300 [APP/PROC/WEB/0] OUT > @ibm-watson/[email protected] watch-css /home/vcap/app
2019-02-26T15:36:33.77+0300 [APP/PROC/WEB/0] OUT > npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive
2019-02-26T15:36:33.83+0300 [APP/PROC/WEB/0] ERR sh: 1: react-scripts: not found
2019-02-26T15:36:33.85+0300 [APP/PROC/WEB/0] ERR npm ERR! Linux 4.15.0-43-generic
2019-02-26T15:36:33.85+0300 [APP/PROC/WEB/0] ERR npm ERR! argv "/home/vcap/app/vendor/node/bin/node" "/home/vcap/app/vendor/node/lib/node_modules/npm/bin/npm-cli.js" "run" "start-js"
2019-02-26T15:36:33.85+0300 [APP/PROC/WEB/0] ERR npm ERR! node v6.16.0
2019-02-26T15:36:33.85+0300 [APP/PROC/WEB/0] ERR npm ERR! npm v3.10.10
2019-02-26T15:36:33.85+0300 [APP/PROC/WEB/0] ERR npm ERR! file sh
2019-02-26T15:36:33.85+0300 [APP/PROC/WEB/0] ERR npm ERR! code ELIFECYCLE
2019-02-26T15:36:33.85+0300 [APP/PROC/WEB/0] ERR npm ERR! errno ENOENT
2019-02-26T15:36:33.85+0300 [APP/PROC/WEB/0] ERR npm ERR! syscall spawn

Also in the build process there was a warning, not sure it has relation to above problem...

2019-02-26T15:35:55.53+0300 [STG/0] OUT -----> Installing App Management
2019-02-26T15:35:55.64+0300 [STG/0] OUT WARN: App Management cannot be installed because the start script cannot be found.
2019-02-26T15:35:55.64+0300 [STG/0] OUT To install App Management utilities, specify your 'node' start script in 'package.json' or 'Procfile'.
2019-02-26T15:35:55.64+0300 [STG/0] OUT Checking for Dynatrace credentials
2019-02-26T15:35:55.65+0300 [STG/0] OUT No Dynatrace Service Found (service with substring dynatrace not found in VCAP_SERVICES)

Appreciate any advice or to share a hint how did you install this sample on bulemix!

Polling for service creation proceeds even if creation failed

If creation of the discovery-for-demo service fails, e.g. due to hitting limit for # services, the polling for service creation still continues (though it looks like it tries to check creation message).
As a result, the deployment job runs for ~60 mins before timing out.

image

See event in Amplitude: https://analytics.amplitude.com/org/10809/project/164470/search/32067388480?sessionHandle=-B_V7AS9oD_d3XYRA_oJ2_%255BOTC%2520server%255D%2520uid%2520ea55efd9-95d9-4553-ac4e-731252c6b82c&eventId=222d9bbe-a38d-11e7-91c4-023ad108511a

Chat does not work

I have followed all steps and managed to do all steps with no errors. When i do npm start it works fine and opens the browser window, however it does not return any conversation. Where can i check logs for an error?

add clickable buttons

same as assistant-simple, please add clickable buttons instead of standard list. if people wants lists they can use html formatting

Callback function "uploadDocumentAsync" timed out.

I have followed the steps in the readme up to npm run train.

When executing the train command, the step of uploading documents to Watson Discovery is not working for me. I get the error Error: Callback function "uploadDocumentAsync" timed out. See attached full console output.

npm_run_train.log

The script does successfully create the Discovery container "demoCollection", but none of the documents are uploaded into it.

Any ideas why the upload would be timing out? I don't know where to start. Let me know if you need more info. Thanks!

Response of Discovery service is not optimized

I'm trying to build Customer Support Agent with Watson Conversation and Discovery Service and uploading FAQs documents (.docx, .pdf, .html) to Discovery service.

I would like to know, how can I have the right answer of a question asked, from documents (html, docx, pdf, ...) uploaded on discovery service ? How can I configure discovery service or discovery.query (){} to return the best answer of user's question ? Should I use another service such as WKS or not ? Please find below my discovery.js file code:

     function sendToDiscovery(query) {
      return new Promise(function(resolve, reject) {
        var DiscoveryV1 = require('watson-developer-cloud/discovery/v1');
    
        var discovery = new DiscoveryV1({
          username: process.env.DISCOVERY_USERNAME,
          password: process.env.DISCOVERY_PASSWORD,
          version_date: '2018-03-05'
        });
    
        var environment_id = process.env.ENVIRONMENT_ID;
        var collection_id = process.env.COLLECTION_ID;
        var params = {query: query,
            //natural_language_query: query
            //filter: score>0.8,
            highlight: true,
            passages_count: 1,
            passages: true,
            return_fields: ['text'],
            count:1,
            return: 'text'
            //aggregation:
            //'[term(enriched_text.entities.text).term(enriched_text.sentiment.document.label),' +
            //'term(enriched_text.categories.label).term(enriched_text.sentiment.document.label),' +
            //'term(enriched_text.concepts.text).term(enriched_text.sentiment.document.label),' +
            //'term(enriched_text.keywords.text).term(enriched_text.sentiment.document.label),' +
            //'term(enriched_text.entities.type).term(enriched_text.sentiment.document.label)]'
        }
        discovery.query({
          environment_id: environment_id,
          collection_id: collection_id,
          configuration_id: process.env.DISCOVERY_CONFIGURATION_ID,
          query : params
        }, function(error, response) {
            if (error) {
              reject(error);
            } else {
              if (response.results == null) {
                console.log("The call to the Discovery service is complete, but he has not returned any replies. Check the format of the data injected into the Discovery service.");
                reject(error);
              } else {
                console.log(response.results[0].text);
                resolve(response.results[0].text);
              }
            }
        });
      });
    }
    module.exports = sendToDiscovery;

Could you help me please ?

Best regards.

cloud deploy

i am not able to run this code in bluemix cloud. please help me with the steps to run the application in cloud directly instead of running it in locally.

The sample does not work with my discovery collection.

I am a newbie and trying to study this sample technology by changing its configuration...
I have built it from sources and tried to run with
serve -s build
It works fine.
Then I changed .env and credentials.json so that it points to my assistant conversation.
In my conversation I created #out_of_scope intent and configured it so, that it returns the same json as in your sample, with below key pattern:

"action": {
      "call_discovery": ""
    }

Re-built and run, it works fine! But calls your sample discovery collection.
As next step, I created my collection, placed one-word document into it, changed .env and credentials.json accordingly and rebuilt.
Watson dialog itself works, but when I ask a #out_of_scope question it does not reply me at all...
I checked the log with Kibana a can see below error messages below.
I did not do any changes in the code, with my Watson dialog it does search in your Discovery collection, but fails to search in my one. What could be wrong?

Appreciate any advice!

Below are messages from Kibana log together with json, returned from Watson dialog:

{
  "_index": "logstash-s-6cb2fb63-e32b-4944-bf19-6e5b23b1c39d-2018.12.06.05",
  "_type": "activation_record",
  "_id": "5acd60f7-0882-4cd2-8462-333aba2705e4",
  "_score": null,
  "_source": {
    "end_date": "2018-12-06T17:56:53.926Z",
    "cause_str": "512554e0f9e54ff0a554e0f9e53ff0aa",
    "name_str": "discovery",
    "time_date": "2018-12-06T17:56:52.936Z",
    "status_str": "2",
    "message": "{\"error\":\"The action did not produce a valid response and exited unexpectedly.\"}",
    "type": "activation_record",
    "duration_int": 990,
    "event_uuid": "5acd60f7-0882-4cd2-8462-333aba2705e4",
    "namespace_str": "IBM-ServicesIW_dev",
    "activationId_str": "7d903c552d0b469a903c552d0bf69a39",
    "subject_str": "[email protected]",
    "ALCH_TENANT_ID": "6cb2fb63-e32b-4944-bf19-6e5b23b1c39d",
    "logmet_cluster": "topic2-elasticsearch_2",
    "@timestamp": "2018-12-06T17:57:11.248Z",
    "@version": "1",
    "ALCH_ACCOUNT_ID_str": "",
    "version_str": "0.0.2",
    "timestamp": "2018-12-06T17:57:08.710Z"
  },
  "fields": {
    "@timestamp": [
      1544119031248
    ]
  },
  "sort": [
    1544119031248
  ]
},
{
  "_index": "logstash-s-6cb2fb63-e32b-4944-bf19-6e5b23b1c39d-2018.12.06.05",
  "_type": "user_logs",
  "_id": "9537a3a7-4394-4fe9-b7af-10bc6847a420",
  "_score": null,
  "_source": {
    "time_date": "2018-12-06T17:57:07.870Z",
    "message": "There was an issue while collecting your logs. Data might be missing.",
    "type": "user_logs",
    "event_uuid": "9537a3a7-4394-4fe9-b7af-10bc6847a420",
    "activationId_str": "7d903c552d0b469a903c552d0bf69a39",
    "action_str": "IBM-ServicesIW_dev/assistant-with-discovery-openwhisk/discovery",
    "ALCH_TENANT_ID": "6cb2fb63-e32b-4944-bf19-6e5b23b1c39d",
    "logmet_cluster": "topic2-elasticsearch_2",
    "@timestamp": "2018-12-06T17:57:09.460Z",
    "@version": "1",
    "ALCH_ACCOUNT_ID_str": "",
    "stream_str": "stderr",
    "timestamp": "2018-12-06T17:57:08.710Z"
  },
  "fields": {
    "@timestamp": [
      1544119029460
    ]
  },
  "sort": [
    1544119029460
  ]
},
{
  "_index": "logstash-s-6cb2fb63-e32b-4944-bf19-6e5b23b1c39d-2018.12.06.05",
  "_type": "user_logs",
  "_id": "b3bba025-7264-4bfc-b8f8-eccdecb8869a",
  "_score": null,
  "_source": {
    "time_date": "2018-12-06T17:56:53.922729858Z",
    "message": "TypeError: Cannot read property 'length' of undefined\n",
    "type": "user_logs",
    "event_uuid": "b3bba025-7264-4bfc-b8f8-eccdecb8869a",
    "activationId_str": "7d903c552d0b469a903c552d0bf69a39",
    "action_str": "IBM-ServicesIW_dev/assistant-with-discovery-openwhisk/discovery",
    "ALCH_TENANT_ID": "6cb2fb63-e32b-4944-bf19-6e5b23b1c39d",
    "logmet_cluster": "topic2-elasticsearch_2",
    "@timestamp": "2018-12-06T17:57:08.133Z",
    "@version": "1",
    "ALCH_ACCOUNT_ID_str": "",
    "stream_str": "stderr",
    "timestamp": "2018-12-06T17:57:06.707Z"
  },
  "fields": {
    "@timestamp": [
      1544119028133
    ]
  },
  "sort": [
    1544119028133
  ]
}

And here is json message from my Watson dialog, shown in Kibana log:

{
  "_index": "logstash-s-6cb2fb63-e32b-4944-bf19-6e5b23b1c39d-2018.12.06.05",
  "_type": "activation_record",
  "_id": "e6424371-c489-4790-91c6-1983d38539de",
  "_score": null,
  "_source": {
    "end_date": "2018-12-06T17:56:52.419Z",
    "cause_str": "512554e0f9e54ff0a554e0f9e53ff0aa",
    "name_str": "conversation",
    "time_date": "2018-12-06T17:56:51.721Z",
    "status_str": "0",
    "message": "{\"context\":{\"conversation_id\":\"752f629a-5336-43f8-ad2f-ea82591d9125\",\"system\":{\"_node_output_map\":{\"Anything else\":{\"0\":[0,4,1,0,2,3]},\"Welcome\":{\"0\":[0,5,4,2,3,1,0]},\"node_4_1543998983662\":[0]},\"branch_exited\":true,\"branch_exited_reason\":\"completed\",\"dialog_request_counter\":3,\"dialog_stack\":[{\"dialog_node\":\"root\"}],\"dialog_turn_counter\":3,\"initialized\":true}},\"entities\":[],\"input\":{\"text\":\"Glossary\"},\"intents\":[{\"confidence\":0.5520805358886719,\"intent\":\"Out_of_scope\"}],\"output\":{\"action\":{\"call_discovery\":\"\"},\"generic\":[{\"response_type\":\"text\",\"text\":\"That question is out of scope for this application, take a look at the Conversation Enhanced application to handle questions like these.\"}],\"log_messages\":[],\"nodes_visited\":[\"node_1_1543942502836\",\"node_3_1543998291788\",\"node_4_1543998983662\"],\"text\":[\"That question is out of scope for this application, take a look at the Conversation Enhanced application to handle questions like these.\"]}}",
    "type": "activation_record",
    "duration_int": 698,
    "event_uuid": "e6424371-c489-4790-91c6-1983d38539de",
    "namespace_str": "IBM-ServicesIW_dev",
    "activationId_str": "dea8a909de3747fca8a909de37c7fcc9",
    "subject_str": "[email protected]",
    "ALCH_TENANT_ID": "6cb2fb63-e32b-4944-bf19-6e5b23b1c39d",
    "logmet_cluster": "topic2-elasticsearch_2",
    "@timestamp": "2018-12-06T17:56:53.509Z",
    "@version": "1",
    "ALCH_ACCOUNT_ID_str": "",
    "version_str": "0.0.2",
    "timestamp": "2018-12-06T17:56:52.871Z"
  },
  "fields": {
    "@timestamp": [
      1544119013509
    ]
  },
  "sort": [
    1544119013509
  ]
}

bluemix deploy

i am not able to run this code in bluemix cloud. please help me with the steps to run the application in cloud directly instead of running it in locally.

APIKey vs UserName / Paswword

I am trying to run "npm run train" as per the guide but I am getting the following error message....does it have to do that I only have username and password for both the assistant and discovery services and replaced the "ApiKey" and "ApiKeyName" with "username" and "password" in the "credentials.json"....IBM cloud does not appear to automatically provide API keys....

Creating environment
{ Error: {"context":{"requestId":"90799aceff134319b5f363d559f7698a","requestType":"incoming.Identity_Token","userAgent":"watson-developer-cloud-nodejs-3.7.0;","clientIp":"105.227.108.57","url":"https://iam.bluemix.net","instanceId":"iamid-9955f7b67-zlkqv","threadId":"230185","host":"iamid-9955f7b67-zlkqv","startTime":"22.10.2018 15:06:32:158 UTC","endTime":"22.10.2018 15:06:32:236 UTC","elapsedTime":"78","locale":"en_US","clusterName":"iam-id-prfra04-h7e1"},"errorCode":"BXNIM0415E","errorMessage":"Provided API key could not be found"}

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.