watson-client 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d8bcc8b782607a0e9c2628f1df13d0ca60ec291
4
- data.tar.gz: e33a97d3afae785c185989183e82f55a6b226bc2
3
+ metadata.gz: 423c7226a5a9ddbc1953190c62862df443b872fa
4
+ data.tar.gz: '09acdb56d0c8d28dd438e8d3bf8f1fb71d61485b'
5
5
  SHA512:
6
- metadata.gz: acffd645b414ea27a677d755f93248dc15285e250adf4f5048ba505d6961ac8d986518743959768cde821d14af815b832539d84d8d49329426e5ebb8bae02df1
7
- data.tar.gz: c6b26e8682d5c627f2cc8b5c861e3cf18c0976628159e69afb4f417665a8c2081f8ad0b54b6beecab02e8f30efc2c790a9e066c4a2a4a650b0fdcc9b2ba65ec7
6
+ metadata.gz: 3052a73b70db023a56888e0d912ac24b62c9bf4457ffa9663e6c4fbc09e1a4655f5a6b5814f4a2c156d7109cb70243fb39cd21ca2c22e5614c8063d51485fccb
7
+ data.tar.gz: 683569fbbe08b44bf42ff45154dfae562d56a02b5a8f8dfdefa2d199625a08d4d924c7a5f8adf8b79f76f550604b32afb2503cb886d7fc79f5ad326f151804f7
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in probando.gemspec
4
+ gemspec
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ watson-client (0.1.3)
5
+ excon (~> 0.55.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ excon (0.55.0)
11
+
12
+ PLATFORMS
13
+ ruby
14
+
15
+ DEPENDENCIES
16
+ excon (~> 0.55.0)
17
+ watson-client!
18
+
19
+ BUNDLED WITH
20
+ 1.13.6
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Carlos Torres
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.
data/README.md CHANGED
@@ -1,9 +1,25 @@
1
- # w-ruby
2
- API client for watson IPBM services
1
+ # Watson-client
3
2
 
4
- # w-ruby
5
3
  API client for watson IPBM services
6
4
 
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'watson-client'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install watson-client
20
+
21
+ ## Usage
22
+
7
23
  ### Conversation API
8
24
  Initialize your own credentials for Conversation API
9
25
  ```ruby
@@ -78,3 +94,14 @@ until user_input == 'q' || user_input == 'exit'
78
94
  end
79
95
 
80
96
  ```
97
+
98
+ ## Contributing
99
+
100
+ Bug reports and pull requests are welcome on GitHub at https://github.com/katorres02/w-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
101
+
102
+
103
+ ## License
104
+
105
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
106
+
107
+
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "watson"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -12,7 +12,7 @@ module Watson
12
12
  end
13
13
 
14
14
  def send_message(message = '')
15
- return if message.empty?
15
+ return if message.empty? || message.nil?
16
16
  @message = message
17
17
  params = { input: { text: @message }, alternate_intents: true }
18
18
  params.merge!(@context) unless @context.nil?
@@ -30,8 +30,11 @@ module Watson
30
30
  end
31
31
 
32
32
  def build_response(result)
33
- { source: 'conversation', intent: result['intents'][0]['intent'],
34
- message: @message, tittle: @message, body: result['output']['text'] }
33
+ {
34
+ source: 'conversation', intent: result['intents'][0]['intent'],
35
+ message: @message, tittle: @message, body: result['output']['text'],
36
+ context_id: result['context']['conversation_id']
37
+ }
35
38
  end
36
39
 
37
40
  def url
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watson-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Andres Torres Cruz
@@ -14,30 +14,30 @@ dependencies:
14
14
  name: excon
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.55.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.55.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: excon
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 0.55.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 0.55.0
41
41
  description: REST API client for IBM Watson™ services. Conversation, Retrieve & Rank,
42
42
  Conversation enhanced services are available
43
43
  email: carlosandrestorres28@gmail.com
@@ -45,11 +45,17 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - Gemfile
49
+ - Gemfile.lock
50
+ - LICENCE.txt
48
51
  - README.md
52
+ - bin/console
53
+ - bin/setup
49
54
  - lib/watson.rb
50
55
  - lib/watson/conversation.rb
51
56
  - lib/watson/conversation_enhanced.rb
52
57
  - lib/watson/retrieve_and_rank.rb
58
+ - test/watson/conversation.rb
53
59
  homepage: https://github.com/katorres02/w-ruby
54
60
  licenses:
55
61
  - MIT
@@ -70,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
76
  version: '0'
71
77
  requirements: []
72
78
  rubyforge_project:
73
- rubygems_version: 2.6.7
79
+ rubygems_version: 2.5.2
74
80
  signing_key:
75
81
  specification_version: 4
76
82
  summary: REST API client for IBM Watson™ services