voxable-api-ai-ruby 1.1.0 → 1.1.1
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/lib/api-ai-ruby/constants.rb +2 -2
- data/scratch.rb +89 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3f60b2fe21b3f60dca836485331891cda546b20
|
4
|
+
data.tar.gz: bf272acdd61609ade78f93c13fc06657f57acd0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61cff169d6a352175d3c0364f4d4ceb696b6b07c4f7f16ea28b4d40237da6297e425004858899f2bd9b35186df140ad9e1b596a107af170d30c500cc4dc3fa97
|
7
|
+
data.tar.gz: ac01ff6f3045b1ec1ea8a1cc9fc224e793ce3550495a20e50808358aceba8fb45608a4f81e8b2f5513a756925fcd545e85e92d7dd4ea48d18ff4c4b0cb5fdb01
|
data/scratch.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'api-ai-ruby'
|
2
|
+
require 'json'
|
3
|
+
require '/Users/techpeace/.rvm/gems/ruby-2.2.0@vthreat/gems/awesome_print-1.6.1/lib/awesome_print'
|
4
|
+
|
5
|
+
client = ApiAiRuby::Client.new(
|
6
|
+
client_access_token: '6075a4572e17430d8976d3d236962ac4',
|
7
|
+
developer_access_token: '9da728dd53cd47ba8de7b87080ccaa4b',
|
8
|
+
subscription_key: '24c81cc6-0d3d-4a1c-8701-a3bd7ba6b02a',
|
9
|
+
)
|
10
|
+
|
11
|
+
=begin
|
12
|
+
result = client.text_request('hello there')
|
13
|
+
puts result.inspect
|
14
|
+
|
15
|
+
entities = [
|
16
|
+
{
|
17
|
+
name: 'car',
|
18
|
+
entries: [
|
19
|
+
{
|
20
|
+
value: 'car',
|
21
|
+
synonyms: %w(car auto bus trike)
|
22
|
+
}
|
23
|
+
]
|
24
|
+
}
|
25
|
+
]
|
26
|
+
result = client.update_entities_request(entities)
|
27
|
+
|
28
|
+
puts result.inspect
|
29
|
+
|
30
|
+
#curl -k -X PUT --data "[{'name': 'car', 'entries': [{'value':'car', 'synonyms':['car', 'auto', 'bus', 'whip']} ]}]" -H "Content-Type: application/json" -H "Authorization: Bearer 5dae99c607d2462bb11e1c2882816125" -H "ocp-apim-subscription-key: 24c81cc6-0d3d-4a1c-8701-a3bd7ba6b02a" "https://api.api.ai/api/entities?v=20150204"
|
31
|
+
|
32
|
+
intent = {
|
33
|
+
"id": "1dbfe740-2fbd-4c5e-95cf-0b3090eda942",
|
34
|
+
"name": "launchSimulation",
|
35
|
+
"auto": true,
|
36
|
+
"contexts": [],
|
37
|
+
"templates": [
|
38
|
+
"launch a @simulation:simulationName @sys.date-time:simulationTime",
|
39
|
+
"open @simulation:simulationName @sys.date-time:simulationTime",
|
40
|
+
"run a @simulation:simulationName @sys.date-time:simulationTime",
|
41
|
+
"run a @simulation:simulationName simulation @sys.date-time:simulationTime"
|
42
|
+
],
|
43
|
+
"responses": [
|
44
|
+
{
|
45
|
+
"resetContexts": false,
|
46
|
+
"affectedContexts": [],
|
47
|
+
"parameters": [
|
48
|
+
{
|
49
|
+
"required": true,
|
50
|
+
"dataType": "@simulation",
|
51
|
+
"name": "simulationName",
|
52
|
+
"value": "$simulationName",
|
53
|
+
"prompts": [
|
54
|
+
"Okay, which simulation would you like to run?",
|
55
|
+
nil
|
56
|
+
]
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"required": false,
|
60
|
+
"dataType": "@sys.date-time",
|
61
|
+
"name": "simulationTime",
|
62
|
+
"value": "$simulationTime",
|
63
|
+
"defaultValue": ""
|
64
|
+
}
|
65
|
+
],
|
66
|
+
"speech": "okay, launching $simulationName simulation"
|
67
|
+
}
|
68
|
+
],
|
69
|
+
"state": "LEARNED",
|
70
|
+
"priority": 750000,
|
71
|
+
"cortanaCommand": {
|
72
|
+
"navigateOrService": "NAVIGATE",
|
73
|
+
"target": ""
|
74
|
+
},
|
75
|
+
"assistantCommand": {
|
76
|
+
"urlCommand": "",
|
77
|
+
"doCommand": ""
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
result = client.update_intent_request(intent)
|
82
|
+
|
83
|
+
puts result
|
84
|
+
=end
|
85
|
+
|
86
|
+
#result = client.get_intent_request('1dbfe740-2fbd-4c5e-95cf-0b3090eda942')
|
87
|
+
result = client.get_intents_request
|
88
|
+
puts result.to_json
|
89
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voxable-api-ai-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- api.ai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/api-ai-ruby/update_entities_request.rb
|
92
92
|
- lib/api-ai-ruby/update_intent_request.rb
|
93
93
|
- lib/api-ai-ruby/voice_request.rb
|
94
|
+
- scratch.rb
|
94
95
|
- spec/api-ai-ruby/api_spec.rb
|
95
96
|
- spec/api-ai-ruby/client_spec.rb
|
96
97
|
- spec/api-ai-ruby/error_spec.rb
|