theprogrammablemind 7.3.4 → 7.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/client.js +9 -2
  2. package/package.json +32 -32
package/client.js CHANGED
@@ -350,7 +350,6 @@ const processContextsB = ({ config, hierarchy, semantics, generators, json, isTe
350
350
  // okay
351
351
  query = query.slice(overlap.end+1)
352
352
  data.utterance = query
353
- debugger;
354
353
  const json = await doWithRetries(retries, url, data)
355
354
  toDo = setupContexts(json.contexts).slice(1) // take off the start context
356
355
  }
@@ -458,7 +457,9 @@ const doWithRetries = async (n, url, data) => {
458
457
  }
459
458
  }
460
459
  if (result.status >= 500 && result.status < 600) {
461
- throw `Error ${result.status} - ${result.statusText}. If you are using the researcher version try restarting your entodicton server. If takes a few minutes to be up.`
460
+ throw `Error ${result.status} - ${result.statusText}.`
461
+ } if (result.status >= 404) {
462
+ throw `Error ${result.status} - ${result.statusText} - Trying it connect to ${url}`
462
463
  } else {
463
464
  throw `Error ${result.status} - ${result.statusText}`
464
465
  }
@@ -1205,6 +1206,7 @@ const knowledgeModule = async ({
1205
1206
  parser.add_argument('-g', '--greg', { action: 'store_true', help: 'Set the server to be localhost so I can debug stuff' })
1206
1207
  parser.add_argument('-r', '--retrain', { action: 'store_true', help: 'Get the server to retrain the neural nets' })
1207
1208
  parser.add_argument('-q', '--query', { help: 'Run the specified query' })
1209
+ parser.add_argument('-ip ', '--server', { help: 'Server to run against' })
1208
1210
  parser.add_argument('-qd', '--queryDelete', { help: 'Delete the specified query from the tests file' })
1209
1211
  parser.add_argument('-c', '--clean', { help: 'Remove data from the test files. a === association' })
1210
1212
  parser.add_argument('-od', '--objectDiff', { action: 'store_true', help: 'When showing the objects use a colour diff' })
@@ -1259,6 +1261,9 @@ const knowledgeModule = async ({
1259
1261
  if (args.greg) {
1260
1262
  config.server('http://localhost:3000', '6804954f-e56d-471f-bbb8-08e3c54d9321')
1261
1263
  }
1264
+ if (args.server) {
1265
+ config.server(args.server)
1266
+ }
1262
1267
 
1263
1268
  if (args.debug) {
1264
1269
  config.config.debug = true
@@ -1439,6 +1444,8 @@ const knowledgeModule = async ({
1439
1444
  // const contexts = { failures: results }
1440
1445
  l(n - 1, hasError || newError)
1441
1446
  }).catch((error) => {
1447
+ console.error(error)
1448
+ process.exit(-1)
1442
1449
  errorHandler(error)
1443
1450
  })
1444
1451
  }
package/package.json CHANGED
@@ -1,29 +1,6 @@
1
1
  {
2
- "version": "7.3.4",
3
- "license": "ISC",
4
- "main": "index.js",
5
- "devDependencies": {
6
- "eslint": "^7.31.0",
7
- "eslint-plugin-node": "^11.1.0",
8
- "eslint-plugin-promise": "^5.1.0",
9
- "@typescript-eslint/parser": "^4.28.4",
10
- "jest": "^26.6.3",
11
- "eslint-plugin-import": "^2.23.4",
12
- "@typescript-eslint/eslint-plugin": "^4.28.4",
13
- "eslint-config-standard": "^16.0.3"
14
- },
15
- "scripts": {
16
- "test": "jest --config ./jest.config.json",
17
- "lint": "eslint \"**/*.js\"",
18
- "test:watch": "npm run test -- --watch",
19
- "to": "node node_modules/.bin/jest --runInBand -t NEO",
20
- "tod": "node inspect node_modules/.bin/jest --runInBand -t NEO",
21
- "test:debug": "node inspect node_modules/.bin/jest --runInBand --config ./jest.config.json",
22
- "lint:fix": "eslint \"**/*.js\" --fix",
23
- "to:debug": "node inspect node_modules/.bin/jest --runInBand -t NEO"
24
- },
25
- "name": "theprogrammablemind",
26
2
  "author": "dev@thinktelligence.com",
3
+ "license": "ISC",
27
4
  "keywords": [
28
5
  "NLP",
29
6
  "NLU",
@@ -33,6 +10,8 @@
33
10
  "natural language understanding",
34
11
  "chatbot"
35
12
  ],
13
+ "version": "7.3.5",
14
+ "main": "index.js",
36
15
  "files": [
37
16
  "client.js",
38
17
  "index.js",
@@ -48,18 +27,39 @@
48
27
  "src/generators.js",
49
28
  "src/semantics.js"
50
29
  ],
30
+ "scripts": {
31
+ "tod": "node inspect node_modules/.bin/jest --runInBand -t NEO",
32
+ "lint": "eslint \"**/*.js\"",
33
+ "to:debug": "node inspect node_modules/.bin/jest --runInBand -t NEO",
34
+ "lint:fix": "eslint \"**/*.js\" --fix",
35
+ "test:watch": "npm run test -- --watch",
36
+ "test:debug": "node inspect node_modules/.bin/jest --runInBand --config ./jest.config.json",
37
+ "test": "jest --config ./jest.config.json",
38
+ "to": "node node_modules/.bin/jest --runInBand -t NEO"
39
+ },
40
+ "name": "theprogrammablemind",
51
41
  "dependencies": {
52
- "underscore": "^1.13.1",
53
42
  "deep-equal": "^2.0.4",
54
- "json-stable-stringify": "^1.0.1",
55
43
  "fs": "0.0.1-security",
56
- "node-fetch": "^2.6.1",
57
- "readline": "^1.3.0",
58
- "json-diff": "^1.0.3",
59
- "scriptjs": "^2.5.9",
44
+ "lodash": "^4.17.20",
45
+ "underscore": "^1.13.1",
46
+ "uuid": "^8.3.2",
60
47
  "base-64": "^1.0.0",
48
+ "json-diff": "^1.0.3",
61
49
  "sort-json": "^2.0.0",
62
- "uuid": "^8.3.2",
63
- "lodash": "^4.17.20"
50
+ "json-stable-stringify": "^1.0.1",
51
+ "node-fetch": "^2.6.1",
52
+ "readline": "^1.3.0",
53
+ "scriptjs": "^2.5.9"
54
+ },
55
+ "devDependencies": {
56
+ "jest": "^26.6.3",
57
+ "eslint-plugin-promise": "^5.1.0",
58
+ "eslint-plugin-node": "^11.1.0",
59
+ "@typescript-eslint/eslint-plugin": "^4.28.4",
60
+ "eslint-plugin-import": "^2.23.4",
61
+ "eslint-config-standard": "^16.0.3",
62
+ "@typescript-eslint/parser": "^4.28.4",
63
+ "eslint": "^7.31.0"
64
64
  }
65
65
  }