theprogrammablemind_4wp 9.7.1-beta.17 → 9.7.1-beta.18
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.
- package/client.js +18 -3
- package/package.json +1 -1
- package/src/generators.js +3 -3
- package/src/semantics.js +2 -2
package/client.js
CHANGED
|
@@ -337,7 +337,9 @@ const _process = async (config, query, { initializer, commandLineArgs, credentia
|
|
|
337
337
|
data.utterance = queries[0]
|
|
338
338
|
data.start_counter = startCounter
|
|
339
339
|
let json = await doWithRetries(retries, url, queryParams, data)
|
|
340
|
-
|
|
340
|
+
if (json.logs) {
|
|
341
|
+
logs.push(...json.logs)
|
|
342
|
+
}
|
|
341
343
|
let resetData = false
|
|
342
344
|
if (json.code === 'NOT_IN_CACHE') {
|
|
343
345
|
resetData = true
|
|
@@ -388,6 +390,7 @@ const _process = async (config, query, { initializer, commandLineArgs, credentia
|
|
|
388
390
|
response.trace = response.trace.concat(json.trace)
|
|
389
391
|
response.version = json.version
|
|
390
392
|
response.explain_priorities = json.explain_priorities
|
|
393
|
+
response.explain_associations = json.explain_associations
|
|
391
394
|
response.contextual_priorities_ambiguities = json.contextual_priorities_ambiguities
|
|
392
395
|
// response.rtf_associations = json.rtf_associations
|
|
393
396
|
|
|
@@ -889,6 +892,11 @@ const defaultInnerProcess = (config, errorHandler, responses) => {
|
|
|
889
892
|
console.log(` inputs: ${JSON.stringify(inputs)} output: ${JSON.stringify(output)} reason: ${reason}`)
|
|
890
893
|
}
|
|
891
894
|
}
|
|
895
|
+
|
|
896
|
+
if (responses.explain_associations) {
|
|
897
|
+
console.log(responses.explain_associations)
|
|
898
|
+
}
|
|
899
|
+
|
|
892
900
|
// const objects = config.get('objects').namespaced[config.uuid]
|
|
893
901
|
const actualGetObjects = (name) => {
|
|
894
902
|
if (!name) {
|
|
@@ -1137,7 +1145,6 @@ const rebuildTemplate = async ({ config, instance, target, previousResultss, reb
|
|
|
1137
1145
|
delete result.memory_free_percent
|
|
1138
1146
|
delete result.logs
|
|
1139
1147
|
delete result.version
|
|
1140
|
-
result.hierarchy.sort()
|
|
1141
1148
|
// stabilizeAssociations(result.associations)
|
|
1142
1149
|
result.learned_contextual_priorities = safeNoDups(result.learned_contextual_priorities)
|
|
1143
1150
|
}
|
|
@@ -1375,6 +1382,7 @@ const knowledgeModuleImpl = async ({
|
|
|
1375
1382
|
parser.add_argument('-dcp', '--debugContextualPriority', { action: 'store_true', help: helpDebugContextualPriority })
|
|
1376
1383
|
parser.add_argument('-db', '--debugBridge', { action: 'store_true', help: helpDebugBridge })
|
|
1377
1384
|
parser.add_argument('-do', '--debugOperator', { action: 'store_true', help: helpDebugOperator })
|
|
1385
|
+
parser.add_argument('-ea', '--explainAssociations', { action: 'store_true', help: 'The server will return information about the associations used to decide on the interpretation.' })
|
|
1378
1386
|
parser.add_argument('-ep', '--explainPriorities', { action: 'store_true', help: 'The server will return all priorities including the generated one along with an explanation of there they came from' })
|
|
1379
1387
|
parser.add_argument('-dic', '--debugIncludeConvolutions', { nargs: '?', help: 'When running with the --debugIncludeConvolutions flag the logs will include convolutions which are somewhat annoyingly verbose. Default is false' })
|
|
1380
1388
|
parser.add_argument('-bc', '--bypassCache', { action: 'store_true', help: 'Bypass the cache on the server side and rebuild' })
|
|
@@ -1513,6 +1521,10 @@ const knowledgeModuleImpl = async ({
|
|
|
1513
1521
|
config.config.explain_priorities = true
|
|
1514
1522
|
}
|
|
1515
1523
|
|
|
1524
|
+
if (args.explainAssociations) {
|
|
1525
|
+
config.config.explain_associations = true
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1516
1528
|
config.config.debugIncludeConvolutions = args.debugIncludeConvolutions || process.argv.includes('--debugIncludeConvolutions') || process.argv.includes('-dic')
|
|
1517
1529
|
|
|
1518
1530
|
let configPrinted = false
|
|
@@ -1545,7 +1557,10 @@ const knowledgeModuleImpl = async ({
|
|
|
1545
1557
|
if (hasArg('c')) {
|
|
1546
1558
|
const { data } = setupProcessB({ config })
|
|
1547
1559
|
console.log('Config as sent to server')
|
|
1548
|
-
|
|
1560
|
+
const toPrint = { ...data }
|
|
1561
|
+
toPrint['priorities'] = toPrint['priorities'].map((value) => JSON.stringify(value).replace(/\\"/g, '"'))
|
|
1562
|
+
toPrint['associations']['positive'] = toPrint['associations']['positive'].map((value) => JSON.stringify(value).replace(/\\"/g, '"'))
|
|
1563
|
+
console.log(JSON.stringify(toPrint, null, 2).replace(/\\"/g, '"'))
|
|
1549
1564
|
}
|
|
1550
1565
|
if (hasArg('l')) {
|
|
1551
1566
|
console.log('Module load ordering')
|
package/package.json
CHANGED
package/src/generators.js
CHANGED
|
@@ -195,7 +195,7 @@ class Generators {
|
|
|
195
195
|
console.error("TPMKMS_TRACE", debug.counter("TPMKMS_TRACE"))
|
|
196
196
|
console.error(generator.toLabel())
|
|
197
197
|
console.error(generator.toString())
|
|
198
|
-
console.log(`To debug this use debug.breakAt('${args.calls.current()}')`)
|
|
198
|
+
console.log(`To debug this use debug.breakAt('${args.calls.current()}. Check the 'callId' arg to see this value.')`)
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
try {
|
|
@@ -232,7 +232,7 @@ class Generators {
|
|
|
232
232
|
lines.setElement(0, 2, stack)
|
|
233
233
|
lines.newRow()
|
|
234
234
|
lines.setElement(0, 1, 'DEBUG')
|
|
235
|
-
lines.setElement(0, 2, `To debug this use debug.breakAt('${args.calls.current()}')`)
|
|
235
|
+
lines.setElement(0, 2, `To debug this use debug.breakAt('${args.calls.current()}. Check the 'callId' arg to see this value.')`)
|
|
236
236
|
lines.newRow()
|
|
237
237
|
lines.setElement(0, 1, 'ERROR')
|
|
238
238
|
lines.setElement(0, 2, errorMessage)
|
|
@@ -264,7 +264,7 @@ class Generators {
|
|
|
264
264
|
lines.setElement(0, 2, stack)
|
|
265
265
|
lines.newRow()
|
|
266
266
|
lines.setElement(0, 1, 'DEBUG')
|
|
267
|
-
lines.setElement(0, 2, `To debug this use debug.breakAt('${args.calls.current()}')`)
|
|
267
|
+
lines.setElement(0, 2, `To debug this use debug.breakAt('${args.calls.current()}. Check the 'callId' arg to see this value.')`)
|
|
268
268
|
lines.newRow()
|
|
269
269
|
lines.setElement(0, 1, 'TO')
|
|
270
270
|
lines.setElement(0, 2, `context_id: ${context.context_id}`)
|
package/src/semantics.js
CHANGED
|
@@ -260,7 +260,7 @@ class Semantics {
|
|
|
260
260
|
lines.setElement(0, 2, semantic.toString())
|
|
261
261
|
lines.newRow()
|
|
262
262
|
lines.setElement(0, 1, 'DEBUG')
|
|
263
|
-
lines.setElement(0, 2, `To debug this use debug.breakAt('${args.calls.current()}')`)
|
|
263
|
+
lines.setElement(0, 2, `To debug this use debug.breakAt('${args.calls.current()}. Check the 'callId' arg to see this value.')`)
|
|
264
264
|
lines.newRow()
|
|
265
265
|
lines.setElement(0, 1, 'TO')
|
|
266
266
|
lines.setElement(0, 2, `context_id: ${context.context_id}`)
|
|
@@ -295,7 +295,7 @@ class Semantics {
|
|
|
295
295
|
lines.setElement(0, 2, semantic.toString())
|
|
296
296
|
lines.newRow()
|
|
297
297
|
lines.setElement(0, 1, 'DEBUG')
|
|
298
|
-
lines.setElement(0, 2, `To debug this use debug.breakAt('${args.calls.current()}')`)
|
|
298
|
+
lines.setElement(0, 2, `To debug this use debug.breakAt('${args.calls.current()}. Check the 'callId' arg to see this value.')`)
|
|
299
299
|
lines.newRow()
|
|
300
300
|
lines.setElement(0, 1, 'TO')
|
|
301
301
|
lines.setElement(0, 2, `context_id: ${context.context_id}`)
|