azure_cognitiveservices_luisruntime 0.17.0

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 (22) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2.0/generated/azure_cognitiveservices_luisruntime.rb +37 -0
  4. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/luis_runtime_client.rb +131 -0
  5. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/apierror.rb +57 -0
  6. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/composite_child_model.rb +57 -0
  7. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/composite_entity_model.rb +77 -0
  8. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/entity_model.rb +100 -0
  9. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/entity_with_resolution.rb +94 -0
  10. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/entity_with_score.rb +98 -0
  11. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/intent_model.rb +61 -0
  12. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/luis_result.rb +156 -0
  13. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/models/sentiment.rb +59 -0
  14. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/module_definition.rb +9 -0
  15. data/lib/2.0/generated/azure_cognitiveservices_luisruntime/prediction.rb +161 -0
  16. data/lib/azure_cognitiveservices_luisruntime.rb +6 -0
  17. data/lib/module_definition.rb +7 -0
  18. data/lib/profiles/latest/luisruntime_latest_profile_client.rb +38 -0
  19. data/lib/profiles/latest/luisruntime_module_definition.rb +8 -0
  20. data/lib/profiles/latest/modules/luisruntime_profile_module.rb +95 -0
  21. data/lib/version.rb +7 -0
  22. metadata +139 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 85f9c0210b8fc5a2254b6ce693d8b7ba32e4956d
4
+ data.tar.gz: b38bad93306bd06045d1b6270bef86b35e8f5d09
5
+ SHA512:
6
+ metadata.gz: 7a50c28c81f105c0de7633ecdbbb0fd06230041fc1ca3bada7e79c373e56282b829185f81ac8975ae526c5f34e0bf4f701847c56c62df3adb5106a9f24836932
7
+ data.tar.gz: a331aa2d9f06c35071c6db3b5161047a9daa78e500da0887f77e998431e2ae3c444f7badfa2b6cc373819dbe9c3d3d484145383aadaefbd2a2632667f1b8d7c1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # encoding: utf-8
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
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2.0/generated/azure_cognitiveservices_luisruntime/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::CognitiveServices::LuisRuntime::V2_0
23
+ autoload :Prediction, '2.0/generated/azure_cognitiveservices_luisruntime/prediction.rb'
24
+ autoload :LuisRuntimeClient, '2.0/generated/azure_cognitiveservices_luisruntime/luis_runtime_client.rb'
25
+
26
+ module Models
27
+ autoload :Sentiment, '2.0/generated/azure_cognitiveservices_luisruntime/models/sentiment.rb'
28
+ autoload :LuisResult, '2.0/generated/azure_cognitiveservices_luisruntime/models/luis_result.rb'
29
+ autoload :EntityModel, '2.0/generated/azure_cognitiveservices_luisruntime/models/entity_model.rb'
30
+ autoload :CompositeChildModel, '2.0/generated/azure_cognitiveservices_luisruntime/models/composite_child_model.rb'
31
+ autoload :CompositeEntityModel, '2.0/generated/azure_cognitiveservices_luisruntime/models/composite_entity_model.rb'
32
+ autoload :IntentModel, '2.0/generated/azure_cognitiveservices_luisruntime/models/intent_model.rb'
33
+ autoload :APIError, '2.0/generated/azure_cognitiveservices_luisruntime/models/apierror.rb'
34
+ autoload :EntityWithScore, '2.0/generated/azure_cognitiveservices_luisruntime/models/entity_with_score.rb'
35
+ autoload :EntityWithResolution, '2.0/generated/azure_cognitiveservices_luisruntime/models/entity_with_resolution.rb'
36
+ end
37
+ end
@@ -0,0 +1,131 @@
1
+ # encoding: utf-8
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
+ module Azure::CognitiveServices::LuisRuntime::V2_0
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class LuisRuntimeClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_reader :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials1
19
+
20
+ # @return [String] Supported Cognitive Services endpoints (protocol and
21
+ # hostname, for example: https://westus.api.cognitive.microsoft.com).
22
+ attr_accessor :endpoint
23
+
24
+ # @return Subscription credentials which uniquely identify client
25
+ # subscription.
26
+ attr_accessor :credentials
27
+
28
+ # @return [String] The preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
38
+ attr_accessor :generate_client_request_id
39
+
40
+ # @return [Prediction] prediction
41
+ attr_reader :prediction
42
+
43
+ #
44
+ # Creates initializes a new instance of the LuisRuntimeClient class.
45
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
46
+ # @param options [Array] filters to be applied to the HTTP requests.
47
+ #
48
+ def initialize(credentials = nil, options = nil)
49
+ super(credentials, options)
50
+ @base_url = '{Endpoint}/luis/v2.0'
51
+
52
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
53
+ @credentials = credentials
54
+
55
+ @prediction = Prediction.new(self)
56
+ @accept_language = 'en-US'
57
+ @long_running_operation_retry_timeout = 30
58
+ @generate_client_request_id = true
59
+ add_telemetry
60
+ end
61
+
62
+ #
63
+ # Makes a request and returns the body of the response.
64
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
65
+ # @param path [String] the path, relative to {base_url}.
66
+ # @param options [Hash{String=>String}] specifying any request options like :body.
67
+ # @return [Hash{String=>String}] containing the body of the response.
68
+ # Example:
69
+ #
70
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
71
+ # path = "/path"
72
+ # options = {
73
+ # body: request_content,
74
+ # query_params: {'api-version' => '2016-02-01'}
75
+ # }
76
+ # result = @client.make_request(:put, path, options)
77
+ #
78
+ def make_request(method, path, options = {})
79
+ result = make_request_with_http_info(method, path, options)
80
+ result.body unless result.nil?
81
+ end
82
+
83
+ #
84
+ # Makes a request and returns the operation response.
85
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
86
+ # @param path [String] the path, relative to {base_url}.
87
+ # @param options [Hash{String=>String}] specifying any request options like :body.
88
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
89
+ #
90
+ def make_request_with_http_info(method, path, options = {})
91
+ result = make_request_async(method, path, options).value!
92
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
93
+ result
94
+ end
95
+
96
+ #
97
+ # Makes a request asynchronously.
98
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
99
+ # @param path [String] the path, relative to {base_url}.
100
+ # @param options [Hash{String=>String}] specifying any request options like :body.
101
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
102
+ #
103
+ def make_request_async(method, path, options = {})
104
+ fail ArgumentError, 'method is nil' if method.nil?
105
+ fail ArgumentError, 'path is nil' if path.nil?
106
+
107
+ request_url = options[:base_url] || @base_url
108
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
109
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
110
+ end
111
+
112
+ request_headers = @request_headers
113
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
114
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
115
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
116
+
117
+ super(request_url, method, path, options)
118
+ end
119
+
120
+
121
+ private
122
+ #
123
+ # Adds telemetry information.
124
+ #
125
+ def add_telemetry
126
+ sdk_information = 'azure_cognitiveservices_luisruntime'
127
+ sdk_information = "#{sdk_information}/0.17.0"
128
+ add_user_agent_information(sdk_information)
129
+ end
130
+ end
131
+ end
@@ -0,0 +1,57 @@
1
+ # encoding: utf-8
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
+ module Azure::CognitiveServices::LuisRuntime::V2_0
7
+ module Models
8
+ #
9
+ # Error information returned by the API
10
+ #
11
+ class APIError
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] HTTP Status code
16
+ attr_accessor :status_code
17
+
18
+ # @return [String] Cause of the error.
19
+ attr_accessor :message
20
+
21
+
22
+ #
23
+ # Mapper for APIError class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'APIError',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'APIError',
34
+ model_properties: {
35
+ status_code: {
36
+ client_side_validation: true,
37
+ required: false,
38
+ serialized_name: 'statusCode',
39
+ type: {
40
+ name: 'String'
41
+ }
42
+ },
43
+ message: {
44
+ client_side_validation: true,
45
+ required: false,
46
+ serialized_name: 'message',
47
+ type: {
48
+ name: 'String'
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,57 @@
1
+ # encoding: utf-8
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
+ module Azure::CognitiveServices::LuisRuntime::V2_0
7
+ module Models
8
+ #
9
+ # Child entity in a LUIS Composite Entity.
10
+ #
11
+ class CompositeChildModel
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Type of child entity.
16
+ attr_accessor :type
17
+
18
+ # @return [String] Value extracted by LUIS.
19
+ attr_accessor :value
20
+
21
+
22
+ #
23
+ # Mapper for CompositeChildModel class as Ruby Hash.
24
+ # This will be used for serialization/deserialization.
25
+ #
26
+ def self.mapper()
27
+ {
28
+ client_side_validation: true,
29
+ required: false,
30
+ serialized_name: 'CompositeChildModel',
31
+ type: {
32
+ name: 'Composite',
33
+ class_name: 'CompositeChildModel',
34
+ model_properties: {
35
+ type: {
36
+ client_side_validation: true,
37
+ required: true,
38
+ serialized_name: 'type',
39
+ type: {
40
+ name: 'String'
41
+ }
42
+ },
43
+ value: {
44
+ client_side_validation: true,
45
+ required: true,
46
+ serialized_name: 'value',
47
+ type: {
48
+ name: 'String'
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,77 @@
1
+ # encoding: utf-8
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
+ module Azure::CognitiveServices::LuisRuntime::V2_0
7
+ module Models
8
+ #
9
+ # LUIS Composite Entity.
10
+ #
11
+ class CompositeEntityModel
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] Type/name of parent entity.
16
+ attr_accessor :parent_type
17
+
18
+ # @return [String] Value for composite entity extracted by LUIS.
19
+ attr_accessor :value
20
+
21
+ # @return [Array<CompositeChildModel>] Child entities.
22
+ attr_accessor :children
23
+
24
+
25
+ #
26
+ # Mapper for CompositeEntityModel class as Ruby Hash.
27
+ # This will be used for serialization/deserialization.
28
+ #
29
+ def self.mapper()
30
+ {
31
+ client_side_validation: true,
32
+ required: false,
33
+ serialized_name: 'CompositeEntityModel',
34
+ type: {
35
+ name: 'Composite',
36
+ class_name: 'CompositeEntityModel',
37
+ model_properties: {
38
+ parent_type: {
39
+ client_side_validation: true,
40
+ required: true,
41
+ serialized_name: 'parentType',
42
+ type: {
43
+ name: 'String'
44
+ }
45
+ },
46
+ value: {
47
+ client_side_validation: true,
48
+ required: true,
49
+ serialized_name: 'value',
50
+ type: {
51
+ name: 'String'
52
+ }
53
+ },
54
+ children: {
55
+ client_side_validation: true,
56
+ required: true,
57
+ serialized_name: 'children',
58
+ type: {
59
+ name: 'Sequence',
60
+ element: {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'CompositeChildModelElementType',
64
+ type: {
65
+ name: 'Composite',
66
+ class_name: 'CompositeChildModel'
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,100 @@
1
+ # encoding: utf-8
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
+ module Azure::CognitiveServices::LuisRuntime::V2_0
7
+ module Models
8
+ #
9
+ # An entity extracted from the utterance.
10
+ #
11
+ class EntityModel
12
+
13
+ include MsRestAzure
14
+
15
+ # @return Unmatched properties from the message are deserialized this
16
+ # collection
17
+ attr_accessor :additional_properties
18
+
19
+ # @return [String] Name of the entity, as defined in LUIS.
20
+ attr_accessor :entity
21
+
22
+ # @return [String] Type of the entity, as defined in LUIS.
23
+ attr_accessor :type
24
+
25
+ # @return [Integer] The position of the first character of the matched
26
+ # entity within the utterance.
27
+ attr_accessor :start_index
28
+
29
+ # @return [Integer] The position of the last character of the matched
30
+ # entity within the utterance.
31
+ attr_accessor :end_index
32
+
33
+
34
+ #
35
+ # Mapper for EntityModel class as Ruby Hash.
36
+ # This will be used for serialization/deserialization.
37
+ #
38
+ def self.mapper()
39
+ {
40
+ client_side_validation: true,
41
+ required: false,
42
+ serialized_name: 'EntityModel',
43
+ type: {
44
+ name: 'Composite',
45
+ class_name: 'EntityModel',
46
+ model_properties: {
47
+ additional_properties: {
48
+ client_side_validation: true,
49
+ required: false,
50
+ type: {
51
+ name: 'Dictionary',
52
+ value: {
53
+ client_side_validation: true,
54
+ required: false,
55
+ serialized_name: 'ObjectElementType',
56
+ type: {
57
+ name: 'Object'
58
+ }
59
+ }
60
+ }
61
+ },
62
+ entity: {
63
+ client_side_validation: true,
64
+ required: true,
65
+ serialized_name: 'entity',
66
+ type: {
67
+ name: 'String'
68
+ }
69
+ },
70
+ type: {
71
+ client_side_validation: true,
72
+ required: true,
73
+ serialized_name: 'type',
74
+ type: {
75
+ name: 'String'
76
+ }
77
+ },
78
+ start_index: {
79
+ client_side_validation: true,
80
+ required: true,
81
+ serialized_name: 'startIndex',
82
+ type: {
83
+ name: 'Number'
84
+ }
85
+ },
86
+ end_index: {
87
+ client_side_validation: true,
88
+ required: true,
89
+ serialized_name: 'endIndex',
90
+ type: {
91
+ name: 'Number'
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ end
98
+ end
99
+ end
100
+ end