Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit 814366b

Browse files
Chris McConnellStevenic
authored andcommitted
Chrimc sentiment (#340)
* Move luis client library into botbuilder-ai. * Update to the latest swagger file. * Update to latest swagger and udpate oracles to include sentiment. * Add generated files excluded by .gitignore.
1 parent f10a443 commit 814366b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1971
-1924
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 Microsoft
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Code generated by Microsoft (R) AutoRest Code Generator.
3+
* Changes may cause incorrect behavior and will be lost if the code is
4+
* regenerated.
5+
*/
6+
7+
import { ServiceClient, ServiceClientOptions } from 'ms-rest';
8+
import * as models from "./models";
9+
import * as operations from "./operations";
10+
11+
export default class LuisClient extends ServiceClient {
12+
/**
13+
* @class
14+
* Initializes a new instance of the LuisClient class.
15+
* @constructor
16+
*
17+
* @param {string} endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
18+
*
19+
* @param {object} [options] - The parameter options
20+
*
21+
* @param {Array} [options.filters] - Filters to be added to the request pipeline
22+
*
23+
* @param {object} [options.requestOptions] - Options for the underlying request object
24+
* {@link https://github.com/request/request#requestoptions-callback Options doc}
25+
*
26+
* @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
27+
*
28+
*/
29+
constructor(endpoint: string, options?: ServiceClientOptions);
30+
31+
endpoint: string;
32+
33+
// Operation groups
34+
prediction: operations.Prediction;
35+
}
36+
37+
export { LuisClient, models as LuisModels };
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Code generated by Microsoft (R) AutoRest Code Generator.
3+
* Changes may cause incorrect behavior and will be lost if the code is
4+
* regenerated.
5+
*/
6+
7+
/* jshint latedef:false */
8+
/* jshint forin:false */
9+
/* jshint noempty:false */
10+
11+
'use strict';
12+
13+
const msRest = require('ms-rest');
14+
const ServiceClient = msRest.ServiceClient;
15+
16+
const models = require('./models');
17+
const operations = require('./operations');
18+
19+
20+
/** Class representing a LuisClient. */
21+
class LuisClient extends ServiceClient {
22+
/**
23+
* Create a LuisClient.
24+
* @param {string} endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).
25+
* @param {object} [options] - The parameter options
26+
* @param {Array} [options.filters] - Filters to be added to the request pipeline
27+
* @param {object} [options.requestOptions] - Options for the underlying request object
28+
* {@link https://github.com/request/request#requestoptions-callback Options doc}
29+
* @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
30+
*/
31+
constructor(endpoint, options) {
32+
if (endpoint === null || endpoint === undefined) {
33+
throw new Error('\'endpoint\' cannot be null.');
34+
}
35+
36+
if (!options) options = {};
37+
38+
super(null, options);
39+
40+
this.baseUri = '{Endpoint}/luis/v2.0';
41+
this.endpoint = endpoint;
42+
43+
let packageInfo = this.getPackageJsonInfo(__dirname);
44+
this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`);
45+
this.prediction = new operations.Prediction(this);
46+
this.models = models;
47+
msRest.addSerializationMixin(this);
48+
}
49+
50+
}
51+
52+
module.exports = LuisClient;
53+
module.exports['default'] = LuisClient;
54+
module.exports.LuisClient = LuisClient;
55+
module.exports.LuisModels = models;
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* Code generated by Microsoft (R) AutoRest Code Generator.
3+
* Changes may cause incorrect behavior and will be lost if the code is
4+
* regenerated.
5+
*/
6+
7+
'use strict';
8+
9+
/**
10+
* Error information returned by the API
11+
*
12+
*/
13+
class APIError {
14+
/**
15+
* Create a APIError.
16+
* @member {string} [statusCode] HTTP Status code
17+
* @member {string} [message] Cause of the error.
18+
*/
19+
constructor() {
20+
}
21+
22+
/**
23+
* Defines the metadata of APIError
24+
*
25+
* @returns {object} metadata of APIError
26+
*
27+
*/
28+
mapper() {
29+
return {
30+
required: false,
31+
serializedName: 'APIError',
32+
type: {
33+
name: 'Composite',
34+
className: 'APIError',
35+
modelProperties: {
36+
statusCode: {
37+
required: false,
38+
serializedName: 'statusCode',
39+
type: {
40+
name: 'String'
41+
}
42+
},
43+
message: {
44+
required: false,
45+
serializedName: 'message',
46+
type: {
47+
name: 'String'
48+
}
49+
}
50+
}
51+
}
52+
};
53+
}
54+
}
55+
56+
module.exports = APIError;

libraries/botframework-luis/lib/models/compositeChild.js renamed to libraries/botbuilder-ai/generated/lib/models/compositeChildModel.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
11
/*
2-
* Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
2+
* Code generated by Microsoft (R) AutoRest Code Generator.
33
* Changes may cause incorrect behavior and will be lost if the code is
44
* regenerated.
55
*/
66

77
'use strict';
88

99
/**
10-
* Child entity in Luis composite entity.
10+
* Child entity in a LUIS Composite Entity.
1111
*
1212
*/
13-
class CompositeChild {
13+
class CompositeChildModel {
1414
/**
15-
* Create a CompositeChild.
15+
* Create a CompositeChildModel.
1616
* @member {string} type Type of child entity.
17-
* @member {string} value Value extracted by Luis.
17+
* @member {string} value Value extracted by LUIS.
1818
*/
1919
constructor() {
2020
}
2121

2222
/**
23-
* Defines the metadata of CompositeChild
23+
* Defines the metadata of CompositeChildModel
2424
*
25-
* @returns {object} metadata of CompositeChild
25+
* @returns {object} metadata of CompositeChildModel
2626
*
2727
*/
2828
mapper() {
2929
return {
3030
required: false,
31-
serializedName: 'CompositeChild',
31+
serializedName: 'CompositeChildModel',
3232
type: {
3333
name: 'Composite',
34-
className: 'CompositeChild',
34+
className: 'CompositeChildModel',
3535
modelProperties: {
3636
type: {
3737
required: true,
@@ -53,4 +53,4 @@ class CompositeChild {
5353
}
5454
}
5555

56-
module.exports = CompositeChild;
56+
module.exports = CompositeChildModel;

libraries/botframework-luis/lib/models/compositeEntity.js renamed to libraries/botbuilder-ai/generated/lib/models/compositeEntityModel.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
2+
* Code generated by Microsoft (R) AutoRest Code Generator.
33
* Changes may cause incorrect behavior and will be lost if the code is
44
* regenerated.
55
*/
@@ -9,33 +9,32 @@
99
const models = require('./index');
1010

1111
/**
12-
* Luis composite entity. Look at https://www.luis.ai/Help for more
13-
* information.
12+
* LUIS Composite Entity.
1413
*
1514
*/
16-
class CompositeEntity {
15+
class CompositeEntityModel {
1716
/**
18-
* Create a CompositeEntity.
19-
* @member {string} parentType Type of parent entity.
20-
* @member {string} value Value for entity extracted by LUIS.
21-
* @member {array} children
17+
* Create a CompositeEntityModel.
18+
* @member {string} parentType Type/name of parent entity.
19+
* @member {string} value Value for composite entity extracted by LUIS.
20+
* @member {array} children Child entities.
2221
*/
2322
constructor() {
2423
}
2524

2625
/**
27-
* Defines the metadata of CompositeEntity
26+
* Defines the metadata of CompositeEntityModel
2827
*
29-
* @returns {object} metadata of CompositeEntity
28+
* @returns {object} metadata of CompositeEntityModel
3029
*
3130
*/
3231
mapper() {
3332
return {
3433
required: false,
35-
serializedName: 'CompositeEntity',
34+
serializedName: 'CompositeEntityModel',
3635
type: {
3736
name: 'Composite',
38-
className: 'CompositeEntity',
37+
className: 'CompositeEntityModel',
3938
modelProperties: {
4039
parentType: {
4140
required: true,
@@ -58,10 +57,10 @@ class CompositeEntity {
5857
name: 'Sequence',
5958
element: {
6059
required: false,
61-
serializedName: 'CompositeChildElementType',
60+
serializedName: 'CompositeChildModelElementType',
6261
type: {
6362
name: 'Composite',
64-
className: 'CompositeChild'
63+
className: 'CompositeChildModel'
6564
}
6665
}
6766
}
@@ -72,4 +71,4 @@ class CompositeEntity {
7271
}
7372
}
7473

75-
module.exports = CompositeEntity;
74+
module.exports = CompositeEntityModel;
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Code generated by Microsoft (R) AutoRest Code Generator.
3+
* Changes may cause incorrect behavior and will be lost if the code is
4+
* regenerated.
5+
*/
6+
7+
'use strict';
8+
9+
/**
10+
* An entity extracted from the utterance.
11+
*
12+
*/
13+
class EntityModel {
14+
/**
15+
* Create a EntityModel.
16+
* @member {string} entity Name of the entity, as defined in LUIS.
17+
* @member {string} type Type of the entity, as defined in LUIS.
18+
* @member {number} startIndex The position of the first character of the
19+
* matched entity within the utterance.
20+
* @member {number} endIndex The position of the last character of the
21+
* matched entity within the utterance.
22+
*/
23+
constructor() {
24+
}
25+
26+
/**
27+
* Defines the metadata of EntityModel
28+
*
29+
* @returns {object} metadata of EntityModel
30+
*
31+
*/
32+
mapper() {
33+
return {
34+
required: false,
35+
serializedName: 'EntityModel',
36+
type: {
37+
name: 'Composite',
38+
additionalProperties: {
39+
type: {
40+
name: 'Dictionary',
41+
value: {
42+
required: false,
43+
serializedName: 'ObjectElementType',
44+
type: {
45+
name: 'Object'
46+
}
47+
}
48+
}
49+
},
50+
className: 'EntityModel',
51+
modelProperties: {
52+
entity: {
53+
required: true,
54+
serializedName: 'entity',
55+
type: {
56+
name: 'String'
57+
}
58+
},
59+
type: {
60+
required: true,
61+
serializedName: 'type',
62+
type: {
63+
name: 'String'
64+
}
65+
},
66+
startIndex: {
67+
required: true,
68+
serializedName: 'startIndex',
69+
type: {
70+
name: 'Number'
71+
}
72+
},
73+
endIndex: {
74+
required: true,
75+
serializedName: 'endIndex',
76+
type: {
77+
name: 'Number'
78+
}
79+
}
80+
}
81+
}
82+
};
83+
}
84+
}
85+
86+
module.exports = EntityModel;

0 commit comments

Comments
 (0)