RecastAI 3.1.2 → 3.1.3
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.
- checksums.yaml +4 -4
- data/bin/recastcli +39 -0
- data/lib/recastai/utils.rb +2 -2
- data/recastai.gemspec +1 -1
- metadata +4 -6
- data/bin/file +0 -11
- data/bin/text +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69556aaa19b85c4393839be03e8170989e03d61c
|
4
|
+
data.tar.gz: 83efaa654755c9ce778fd0d45053f0397bb7dade
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa44fa0826046e31902e2baf5fe9b8c50eeeb774077a5aaa0ee78ed92aa89f82f439e3c538fa737166f8ca30ffc657ec006a28d45838e00cb1d253919e8b1f06
|
7
|
+
data.tar.gz: c8b7d198b0d1537ae68720558fc19fc217300dae0efd320ed3d35184c33ef2f19e119e653cac8f39c037c3cd78d9f5077eea8e0bf7a16baa0082b61e55ce5db1
|
data/bin/recastcli
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
require_relative '../lib/recastai'
|
6
|
+
|
7
|
+
options = {}
|
8
|
+
OptionParser.new do |opts|
|
9
|
+
opts.banner = "Usage: recastcli -[-t]oken TOKEN <--text TEXT | --file FILE>"
|
10
|
+
|
11
|
+
opts.on('-t', '--token=TOKEN', String, "the request token to use for the call") do |t|
|
12
|
+
options[:token] = t
|
13
|
+
end
|
14
|
+
|
15
|
+
opts.on('--text=TEXT', String, 'the text to process') do |t|
|
16
|
+
options[:text] = t
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on('--file=FILE', String, 'the file to process') do |f|
|
20
|
+
options[:file] = f
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on("-h", "--help", "Prints this help") do
|
24
|
+
puts opts
|
25
|
+
exit
|
26
|
+
end
|
27
|
+
end.parse!
|
28
|
+
|
29
|
+
client = RecastAI::Client.new(options[:token])
|
30
|
+
|
31
|
+
if options[:text]
|
32
|
+
response = client.request.analyse_text(options[:text])
|
33
|
+
elsif options[:file]
|
34
|
+
response = client.request.analyse_file(options[:file])
|
35
|
+
else
|
36
|
+
raise OptionParser::MissingArgument.new('You need to give either --text or --file')
|
37
|
+
end
|
38
|
+
|
39
|
+
puts response.intent
|
data/lib/recastai/utils.rb
CHANGED
@@ -5,8 +5,8 @@ module RecastAI
|
|
5
5
|
# Versioning
|
6
6
|
MAJOR = '3'.freeze
|
7
7
|
MINOR = '1'.freeze
|
8
|
-
|
9
|
-
VERSION = "#{MAJOR}.#{MINOR}.#{
|
8
|
+
PATCH = '3'.freeze
|
9
|
+
VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}".freeze
|
10
10
|
|
11
11
|
# Endpoints
|
12
12
|
TRAIN_ENDPOINT = 'https://api.recast.ai/v2/'.freeze
|
data/recastai.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.authors = ['Paul Renvoisé']
|
18
18
|
spec.email = 'paul.renvoise@recast.ai'
|
19
19
|
spec.files = `git ls-files -z`.split("\x0").reject{ |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
spec.executables = ['
|
20
|
+
spec.executables = ['recastcli']
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
spec.required_ruby_version = '>= 2.2'
|
23
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RecastAI
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Renvoisé
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -98,8 +98,7 @@ description: Recast.AI official SDK for Ruby. Allows you to make requests to you
|
|
98
98
|
bots.
|
99
99
|
email: paul.renvoise@recast.ai
|
100
100
|
executables:
|
101
|
-
-
|
102
|
-
- file
|
101
|
+
- recastcli
|
103
102
|
extensions: []
|
104
103
|
extra_rdoc_files: []
|
105
104
|
files:
|
@@ -110,8 +109,7 @@ files:
|
|
110
109
|
- Gemfile.lock
|
111
110
|
- LICENSE
|
112
111
|
- README.md
|
113
|
-
- bin/
|
114
|
-
- bin/text
|
112
|
+
- bin/recastcli
|
115
113
|
- lib/recastai.rb
|
116
114
|
- lib/recastai/apis/connect/connect.rb
|
117
115
|
- lib/recastai/apis/connect/message.rb
|
data/bin/file
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require_relative '../lib/recastai'
|
4
|
-
|
5
|
-
raise 'You must provide a token for your sentence to be processed' unless ARGV.any? && !ARGV[0].nil?
|
6
|
-
raise 'You must provide a voice file to be processed' unless ARGV.any? && !ARGV[1].nil?
|
7
|
-
|
8
|
-
client = RecastAI::Client.new(ARGV[0])
|
9
|
-
response = client.file_request(ARGV[1])
|
10
|
-
|
11
|
-
ap JSON.parse(response.raw)
|
data/bin/text
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require_relative '../lib/recastai'
|
4
|
-
|
5
|
-
raise 'You must provide a token for your sentence to be processed' unless ARGV.any? && !ARGV[0].nil?
|
6
|
-
raise 'You must provide a sentence to be processed' unless ARGV.any? && !ARGV[1].nil?
|
7
|
-
|
8
|
-
client = RecastAI::Client.new(ARGV[0])
|
9
|
-
response = client.text_request(ARGV[1])
|
10
|
-
|
11
|
-
ap JSON.parse(response.raw)
|