watson-assistant 1.0.6 → 1.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7ee9693b9ba30e8f47c2593223454ea6abafb606b74cfdb3f1a5598438fd1b7
4
- data.tar.gz: d2c70aeabbae5a0091a647e2f4ba0a94c7732eed4951730abded88d168d6b617
3
+ metadata.gz: 4184a78f5c2e115cc5ec7d90a4a00153ab8adc9b89320ad4464e7f0fb40ea3bf
4
+ data.tar.gz: edab7b5c5b5dbd2aa8995a75001bd387621eac26529066e60135e802217cdd6a
5
5
  SHA512:
6
- metadata.gz: f89ad65776d04ab7c301fce0e432110b4f85325f2c8870700b02b479893aac4ac1c9cc4f900f000477164e31f11633625c03bfa785abe50f0ea8e73ca651a35e
7
- data.tar.gz: '09f5bc7341ec7a0c75a1b8d6fafd0f939c172aa8d3285a05d7b3569257c3a0e982c9c08736703e70ea27ab9571cd3724a757607ec16fddb5b60df85a1b543f47'
6
+ metadata.gz: cb984c4324fa4c8447b6d480bdc891d1ad74b0eb2f7df0fc50f6cc75be69f90fcd43259898d3ff57bc1fb523b2db0ee0638bc7f3f11cb5f09b8eb517a4b9fd7e
7
+ data.tar.gz: 26439b05d231e66f984bb95936c1263c5b204a52da87e5726e90f10a675ba222107e1d4c3106fe10fa1438ce7d7d65afa2e301a3c218a2548801d97d9e16b40a
data/README.md CHANGED
@@ -19,22 +19,24 @@ Or install it yourself as:
19
19
  $ gem install watson-assistant
20
20
 
21
21
  ## Usage
22
+ You can use either USERNAME and PASSWORD or API KEY authentication.
23
+
24
+ ### (Username and Passowrd)
25
+ Set the Environment:
22
26
  ```sh
23
27
  export USERNAME="***"
24
28
  export PASSWORD="***"
25
29
  export WORKSPACE_ID="***"
26
30
 
27
- # Optional
28
- # Default region is "gateway.watsonplatform.net"
29
- export REGION="gateway.watsonplatform.net"
31
+ export REGION="gateway.watsonplatform.net" # Optional: Default region is "gateway.watsonplatform.net"
30
32
 
31
- # Optional
32
- # Default storage is ruby hash.
33
33
  # You can select ruby hash or a redis server for managing users.
34
- export STORAGE="hash" # Default
34
+ export STORAGE="hash" # Optional: Default storage is ruby hash.
35
+ # or
35
36
  #export STORAG="redis://127.0.0.1:6379"
36
37
  ```
37
38
 
39
+ Send requests:
38
40
  ```ruby
39
41
  require 'watson/assistant'
40
42
 
@@ -61,6 +63,30 @@ puts manager.has_key?("user1")
61
63
  puts manager.delete("user1")
62
64
  ```
63
65
 
66
+ ### (API KEY)
67
+ Set the Environment:
68
+ ```sh
69
+ export APIKEY="***"
70
+ export WORKSPACE_ID="***"
71
+ export REGION="gateway.watsonplatform.net"
72
+ export STORAGE="hash"
73
+ ```
74
+
75
+ Send requests:
76
+ ```ruby
77
+ require 'watson/assistant'
78
+
79
+ manager = Watson::Assistant::Manager.new(
80
+ apikey: ENV["APIKEY"],
81
+ workspace_id: ENV["WORKSPACE_ID"],
82
+ region: ENV["REGION"],
83
+ storage: ENV["STORAGE"]
84
+ )
85
+
86
+ puts response1 = manager.talk("user1", "")
87
+ puts response2 = manager.talk("user1", "I would like you to ...")
88
+ ```
89
+
64
90
  ## Development
65
91
 
66
92
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,5 @@
1
1
  module Watson
2
2
  module Assistant
3
- VERSION = "1.0.6"
3
+ VERSION = "1.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watson-assistant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - alpha.netzilla
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-20 00:00:00.000000000 Z
11
+ date: 2018-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler