luis 0.1.0 → 0.1.1beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/luis/version.rb +1 -1
- data/lib/luis.rb +12 -4
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1004f19909ba7c65cc8c17b8b9d098c1a16d9a5
|
4
|
+
data.tar.gz: 1ff18bf12bff8de28dc5cd1931d2edabdb7cad49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2574198b9f8136f10d44ed2429096648250bf91e32461fc6d0e9877b59b3bc126405614643240d3c6c33670a34450f1f7c94eb2b8da5e54c5d55761e9387915f
|
7
|
+
data.tar.gz: 5d1631d943c5abf0a7c8af2fc72b77670b2c08cca829a4fa1cfbad034df58e4e884ebe7e34e9e36638ecd12521707cf5b0ab3608ad92e7837ff67c77f9989641
|
data/README.md
CHANGED
data/lib/luis/version.rb
CHANGED
data/lib/luis.rb
CHANGED
@@ -12,9 +12,15 @@ module Luis
|
|
12
12
|
|
13
13
|
include HTTParty
|
14
14
|
class << self
|
15
|
-
attr_accessor :id, :subscription_key
|
15
|
+
attr_accessor :id, :subscription_key, :is_preview_mod, :is_verbose
|
16
|
+
end
|
17
|
+
API_BASE_URI = 'https://api.projectoxford.ai/luis/v1/application'.freeze
|
18
|
+
|
19
|
+
def self.api_uri
|
20
|
+
uri = API_BASE_URI
|
21
|
+
uri += '/preview' if is_preview_mod
|
22
|
+
uri
|
16
23
|
end
|
17
|
-
API_URL = 'https://api.projectoxford.ai/luis/v1/application/preview'.freeze
|
18
24
|
|
19
25
|
# Query method for the luis
|
20
26
|
#
|
@@ -24,7 +30,7 @@ module Luis
|
|
24
30
|
options = default_options
|
25
31
|
options['q'] = query
|
26
32
|
options['contextId'] = context_id if context_id
|
27
|
-
response = get(
|
33
|
+
response = get(api_uri, query: options)
|
28
34
|
Result.new JSON.parse(response.body)
|
29
35
|
end
|
30
36
|
|
@@ -39,6 +45,8 @@ module Luis
|
|
39
45
|
end
|
40
46
|
|
41
47
|
def self.default_options
|
42
|
-
{ 'id' => id, 'subscription-key' => subscription_key }
|
48
|
+
options = { 'id' => id, 'subscription-key' => subscription_key }
|
49
|
+
options['verbose'] = true if is_verbose
|
50
|
+
options
|
43
51
|
end
|
44
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1beta
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aboobacker MK
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -110,9 +110,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
|
-
- - "
|
113
|
+
- - ">"
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
115
|
+
version: 1.3.1
|
116
116
|
requirements: []
|
117
117
|
rubyforge_project:
|
118
118
|
rubygems_version: 2.6.6
|