Skip to content

Commit 3dda4d7

Browse files
author
jbartle9
committed
Changed IEntity.description to IEntity.details - much better name!
1 parent ac5791f commit 3dda4d7

File tree

5 files changed

+140
-6
lines changed

5 files changed

+140
-6
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ framework.
6161
6262
* Entity information from Recast.ai far exceeds that defined for the `IEntity` interface.
6363
Consequently, for each returned entity, the `entity` (string) property of the `IEntity` structure is set to the `raw` property of the Recast entity object,
64-
while an additional property, `description`, is set to the full Recast entity object.
64+
while an additional property, `details`, is set to the full Recast entity object.
6565
* The full Recast response structure can be found in the `recastResult` property of the returned `IIntentRecognizerResult` object.
6666
6767
## Contributing
@@ -72,6 +72,7 @@ Add unit tests for any new or changed functionality. Lint and test your code - s
7272
7373
## Release History
7474
75+
* 0.0.4 Breaking change! "description" in IEntity object changed to "details"
7576
* 0.0.3 Better Recast Entity support, plus tests!
7677
* 0.0.2 Documentation fixes!
7778
* 0.0.1 Initial release

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const rairec = {
4242
if (res.entities) {
4343
res.entities.forEach(function(entity) {
4444
responseEntities.push({
45-
type: entity.name, entity: entity.raw, score: entity.confidence, description: entity
45+
type: entity.name, entity: entity.raw, score: entity.confidence, details: entity
4646
})
4747
})
4848
}

npm-debug.log

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
0 info it worked if it ends with ok
2+
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'publish' ]
3+
2 info using npm@3.8.6
4+
3 info using node@v5.12.0
5+
4 verbose publish [ '.' ]
6+
5 silly cache add args [ '.', null ]
7+
6 verbose cache add spec .
8+
7 silly cache add parsed spec Result {
9+
7 silly cache add raw: '.',
10+
7 silly cache add scope: null,
11+
7 silly cache add name: null,
12+
7 silly cache add rawSpec: '.',
13+
7 silly cache add spec: '/home/jbartle9/Development/git/repositories/recastai-recognizer',
14+
7 silly cache add type: 'directory' }
15+
8 verbose addLocalDirectory /home/jbartle9/.npm/recastai-recognizer/0.0.3/package.tgz not in flight; packing
16+
9 verbose correctMkdir /home/jbartle9/.npm correctMkdir not in flight; initializing
17+
10 info lifecycle recastai-recognizer@0.0.3~prepublish: recastai-recognizer@0.0.3
18+
11 silly lifecycle recastai-recognizer@0.0.3~prepublish: no script for prepublish, continuing
19+
12 verbose tar pack [ '/home/jbartle9/.npm/recastai-recognizer/0.0.3/package.tgz',
20+
12 verbose tar pack '/home/jbartle9/Development/git/repositories/recastai-recognizer' ]
21+
13 verbose tarball /home/jbartle9/.npm/recastai-recognizer/0.0.3/package.tgz
22+
14 verbose folder /home/jbartle9/Development/git/repositories/recastai-recognizer
23+
15 verbose addLocalTarball adding from inside cache /home/jbartle9/.npm/recastai-recognizer/0.0.3/package.tgz
24+
16 verbose correctMkdir /home/jbartle9/.npm correctMkdir not in flight; initializing
25+
17 silly cache afterAdd recastai-recognizer@0.0.3
26+
18 verbose afterAdd /home/jbartle9/.npm/recastai-recognizer/0.0.3/package/package.json not in flight; writing
27+
19 verbose correctMkdir /home/jbartle9/.npm correctMkdir not in flight; initializing
28+
20 verbose afterAdd /home/jbartle9/.npm/recastai-recognizer/0.0.3/package/package.json written
29+
21 silly publish { name: 'recastai-recognizer',
30+
21 silly publish version: '0.0.3',
31+
21 silly publish description: 'An MS Bot Framework IIntentRecognizer implementation for Recast.ai',
32+
21 silly publish main: 'index.js',
33+
21 silly publish scripts: { test: 'make test' },
34+
21 silly publish repository:
35+
21 silly publish { type: 'git',
36+
21 silly publish url: 'git+https://github.com/bassmanitram/recastai-recognizer.git' },
37+
21 silly publish keywords: [ 'recastai', 'botbuilder', 'bots', 'chatbots' ],
38+
21 silly publish author:
39+
21 silly publish { name: 'Martin Bartlett',
40+
21 silly publish email: 'martin.j.bartlett@gmail.com' },
41+
21 silly publish license: 'MIT',
42+
21 silly publish bugs: { url: 'https://github.com/bassmanitram/recastai-recognizer/issues' },
43+
21 silly publish homepage: 'https://github.com/bassmanitram/recastai-recognizer#readme',
44+
21 silly publish dependencies: { recastai: '^2.1.0' },
45+
21 silly publish devDependencies: { chai: '^3.5.0', mocha: '^3.1.1' },
46+
21 silly publish readme: 'recastai-recognizer\n===================\n\nAn MS Bot Framework `IIntentRecognizer` implementation for [Recast.ai](https://recast.ai)\n\n## Prereqs\n* [Recast.ai node.js client, at least version 2](https://www.npmjs.com/package/recastai)\n* [MS Bot Framework node.js SDK](https://www.npmjs.com/package/botbuilder) - though not a technical dependency of this module.\n\n## Installation\n```bash\nnpm install recastai-recognizer\n```\n\n## usage\nThe recognizer is used in basically the same way as the \n[LUIS recognizer plugin](https://docs.botframework.com/en-us/node/builder/guides/understanding-natural-language) \npackaged with the MS Bot Framework SDK. \nIt uses the [Recast.ai node.js client module](https://www.npmjs.com/package/recastai) \nto communicate with your Recast.ai bot:\n```javascript\n/*\n * The Recast.ai-specific bit\n */\nvar rairec = require(\'recastai-recognizer\')\nvar recognizer = new rairec.RecastRecognizer(YOUR_TOKEN, YOUR_LANGUAGE)\n\n/*\n * Standard MS Bot Framework stuff\n */\nvar builder = require(\'botbuilder\')\nvar dialog = new builder.IntentDialog({ recognizers: [recognizer] });\nvar bot = new builder.UniversalBot(MS_BOT_FMWK_CONNECTOR)\nbot.dialog(\'/\', intents)\n\n/*\n * Matching against one Recast.ai intent\n */\ndialog.matches(\'YOUR_INTENT\', function(session, args) {\n ...\n}\n\n/*\n * Matching against one of a number of Recast.ai intents\n */\ndialog.matchesAny([\'YOUR_INTENT_1\', \'YOUR_INTENT_2\' ...], function(session, args) {\n ...\n}\n...\n```\n\n* `YOUR_TOKEN` should be the client token string from your Recast.aia bot\n* `YOUR_LANGUAGE` should be the language in which the utterenaces are made (e.g. `"en"` or `"fr"`)\n\nThis allows the Recast.ai API to be used with the `botbuilder` intent \nmatching facilities, making dialog and bot development with Recast.ai much \nmore intuitive and closer to the recommended style of the `botbuilder` \nframework.\n\n## Notes\n\n* Entity information from Recast.ai far exceeds that defined for the `IEntity` interface.\n Consequently, for each returned entity, the `entity` (string) property of the `IEntity` structure is set to the `raw` property of the Recast entity object,\n while an additional property, `description`, is set to the full Recast entity object.\n* The full Recast response structure can be found in the `recastResult` property of the returned `IIntentRecognizerResult` object.\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. That said, my own style is rather old-school, so any improvements that retain compatibility with the minimum platform requirements of the Recast.ai framework are more than welcome.\n\nAdd unit tests for any new or changed functionality. Lint and test your code - some of which I\'ve been particularly careful to observe in these early releases! \n\n## Release History\n\n* 0.0.3 Better Recast Entity support, plus tests!\n* 0.0.2 Documentation fixes!\n* 0.0.1 Initial release\n',
47+
21 silly publish readmeFilename: 'README.md',
48+
21 silly publish gitHead: 'ac5791f3658bb191477a1d52a8933248f9fe965d',
49+
21 silly publish _id: 'recastai-recognizer@0.0.3',
50+
21 silly publish _shasum: 'd8a17853f85c856057c20570a122f9da5a49bd39',
51+
21 silly publish _from: '.' }
52+
22 verbose getPublishConfig undefined
53+
23 silly mapToRegistry name recastai-recognizer
54+
24 silly mapToRegistry using default registry
55+
25 silly mapToRegistry registry http://registry.npmjs.org/
56+
26 silly mapToRegistry data Result {
57+
26 silly mapToRegistry raw: 'recastai-recognizer',
58+
26 silly mapToRegistry scope: null,
59+
26 silly mapToRegistry name: 'recastai-recognizer',
60+
26 silly mapToRegistry rawSpec: '',
61+
26 silly mapToRegistry spec: 'latest',
62+
26 silly mapToRegistry type: 'tag' }
63+
27 silly mapToRegistry uri http://registry.npmjs.org/recastai-recognizer
64+
28 verbose publish registryBase http://registry.npmjs.org/
65+
29 silly publish uploading /home/jbartle9/.npm/recastai-recognizer/0.0.3/package.tgz
66+
30 verbose request uri http://registry.npmjs.org/recastai-recognizer
67+
31 verbose request sending authorization for write operation
68+
32 info attempt registry request try #1 at 2:23:04 PM
69+
33 verbose request using bearer token for auth
70+
34 verbose request id 4850c9b26df107db
71+
35 http request PUT http://registry.npmjs.org/recastai-recognizer
72+
36 http 408 http://registry.npmjs.org/recastai-recognizer
73+
37 verbose bad json <html><body><h1>408 Request Time-out</h1>
74+
37 verbose bad json Your browser didn't send a complete request in time.
75+
37 verbose bad json </body></html>
76+
38 error registry error parsing json
77+
39 verbose headers { 'content-type': 'text/html',
78+
39 verbose headers 'cache-control': 'max-age=300',
79+
39 verbose headers 'transfer-encoding': 'chunked',
80+
39 verbose headers 'accept-ranges': 'bytes',
81+
39 verbose headers date: 'Mon, 10 Oct 2016 12:23:57 GMT',
82+
39 verbose headers via: '1.1 varnish',
83+
39 verbose headers connection: 'keep-alive',
84+
39 verbose headers 'x-served-by': 'cache-lcy1132-LCY',
85+
39 verbose headers 'x-cache': 'MISS',
86+
39 verbose headers 'x-cache-hits': '0',
87+
39 verbose headers 'x-timer': 'S1476102187.307675,VS0,VE50470',
88+
39 verbose headers vary: 'Accept-Encoding' }
89+
40 info retry will retry, error on last attempt: SyntaxError: Unexpected token <
90+
40 info retry <html><body><h1>408 Request Time-out</h1>
91+
40 info retry Your browser didn't send a complete request in time.
92+
40 info retry </body></html>
93+
41 info attempt registry request try #2 at 2:24:05 PM
94+
42 verbose request using bearer token for auth
95+
43 http request PUT http://registry.npmjs.org/recastai-recognizer
96+
44 http 403 http://registry.npmjs.org/recastai-recognizer
97+
45 verbose headers { 'content-type': 'application/json',
98+
45 verbose headers 'cache-control': 'max-age=300',
99+
45 verbose headers 'content-length': '95',
100+
45 verbose headers 'accept-ranges': 'bytes',
101+
45 verbose headers date: 'Mon, 10 Oct 2016 12:24:10 GMT',
102+
45 verbose headers via: '1.1 varnish',
103+
45 verbose headers connection: 'keep-alive',
104+
45 verbose headers 'x-served-by': 'cache-lcy1132-LCY',
105+
45 verbose headers 'x-cache': 'MISS',
106+
45 verbose headers 'x-cache-hits': '0',
107+
45 verbose headers 'x-timer': 'S1476102247.830400,VS0,VE2705',
108+
45 verbose headers vary: 'Accept-Encoding' }
109+
46 verbose request invalidating /home/jbartle9/.npm/registry.npmjs.org/recastai-recognizer on PUT
110+
47 error publish Failed PUT 403
111+
48 verbose stack Error: "You cannot publish over the previously published version 0.0.3." : recastai-recognizer
112+
48 verbose stack at makeError (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
113+
48 verbose stack at CachingRegistryClient.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:252:14)
114+
48 verbose stack at Request._callback (/usr/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
115+
48 verbose stack at Request.self.callback (/usr/lib/node_modules/npm/node_modules/request/request.js:199:22)
116+
48 verbose stack at emitTwo (events.js:100:13)
117+
48 verbose stack at Request.emit (events.js:185:7)
118+
48 verbose stack at Request.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:1036:10)
119+
48 verbose stack at emitOne (events.js:95:20)
120+
48 verbose stack at Request.emit (events.js:182:7)
121+
48 verbose stack at IncomingMessage.<anonymous> (/usr/lib/node_modules/npm/node_modules/request/request.js:963:12)
122+
49 verbose statusCode 403
123+
50 verbose pkgid recastai-recognizer
124+
51 verbose cwd /home/jbartle9/Development/git/repositories/recastai-recognizer
125+
52 error Linux 3.13.0-96-generic
126+
53 error argv "/usr/bin/nodejs" "/usr/bin/npm" "publish"
127+
54 error node v5.12.0
128+
55 error npm v3.8.6
129+
56 error code E403
130+
57 error "You cannot publish over the previously published version 0.0.3." : recastai-recognizer
131+
58 error If you need help, you may report this error at:
132+
58 error <https://github.com/npm/npm/issues>
133+
59 verbose exit [ 1, true ]

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "recastai-recognizer",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "An MS Bot Framework IIntentRecognizer implementation for Recast.ai",
55
"main": "index.js",
66
"scripts": {

test/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ describe('Recast.ai Recognizer', function() {
8989
expect(recResult.entities[1]).to.have.property('entity').that.is.ok
9090
expect(recResult.entities[2]).to.have.property('entity').that.is.ok
9191

92-
expect(recResult.entities[0]).to.have.property('description').that.is.ok
93-
expect(recResult.entities[1]).to.have.property('description').that.is.ok
94-
expect(recResult.entities[2]).to.have.property('description').that.is.ok
92+
expect(recResult.entities[0]).to.have.property('details').that.is.ok
93+
expect(recResult.entities[1]).to.have.property('details').that.is.ok
94+
expect(recResult.entities[2]).to.have.property('details').that.is.ok
9595

9696
done();
9797
}

0 commit comments

Comments
 (0)