ibm_watson 2.0.0.rc1 → 2.1.1

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
  SHA256:
3
- metadata.gz: bc3db642616c3756e70289cc12aa10b1daa99c33a8e8e6adbae812c8c62cc17c
4
- data.tar.gz: b494d458fb1b8d0fb113689f7f074dd31b1e2c45dd25c946b984fc6925e4ddc8
3
+ metadata.gz: 4855d1f0d0409f6fcf35241392746eeebf914f291324de8800aa887f9e8ee96c
4
+ data.tar.gz: 70ca55c6305cd18b96830799be213fdd2aa33d35252cf7016cb4582e6eafe29c
5
5
  SHA512:
6
- metadata.gz: d51d87ebf4b289227eafce305ddcd4420eeebcb36f69eb134af2bf4bc7176e5b57400efb61f9c45482a741086b26ca838494f25272ee149a8b84aeb1eb2ed01c
7
- data.tar.gz: 3a21b68b6f2d6bd4931125ad1154a1dbf59ed46441486c5791d59630423a951c976bb342e79754558087ba75ce9111f9ffbf6093d8696d565482786a9a359e63
6
+ metadata.gz: 4465338e55529801fb063053aac73c41270d83e258a6bd9f0005f4bdaa511786cfdea38e1b5419d4f276382980f7f1aeb4be376f6ca099266e5d1cf46086f10f
7
+ data.tar.gz: 38beeb9ca5a85c78d0419cbae8868d0cfb2f4200ea3e7ee34f897e86b314049977e790d0302d5ebba268bb869ba2f83bdd586f97ad0cf76f1fbaf93308cd491a
data/README.md CHANGED
@@ -1,13 +1,17 @@
1
1
  # IBM Watson Ruby SDK
2
2
 
3
- [![Build Status](https://travis-ci.org/watson-developer-cloud/ruby-sdk.svg)](https://travis-ci.org/watson-developer-cloud/ruby-sdk)
4
- [![Build status](https://ci.appveyor.com/api/projects/status/ir3k0ue138o4u67e?svg=true)](https://ci.appveyor.com/project/maxnussbaum/ruby-sdk)
3
+ [![Build and Test](https://github.com/watson-developer-cloud/ruby-sdk/workflows/Build%20and%20Test/badge.svg?branch=master)](https://github.com/watson-developer-cloud/ruby-sdk/actions?query=workflow%3A"Build+and+Test")
4
+ [![Deploy and Publish](https://github.com/watson-developer-cloud/ruby-sdk/workflows/Deploy%20and%20Publish/badge.svg?branch=master)](https://github.com/watson-developer-cloud/ruby-sdk/actions?query=workflow%3A%22Deploy+and+Publish%22)
5
5
  [![Slack](https://wdc-slack-inviter.mybluemix.net/badge.svg)](https://wdc-slack-inviter.mybluemix.net)
6
6
  [![codecov.io](https://codecov.io/github/watson-developer-cloud/ruby-sdk/coverage.svg)](https://codecov.io/github/watson-developer-cloud/ruby-sdk)
7
7
  [![Gem Version](https://badge.fury.io/rb/ibm_watson.svg)](https://badge.fury.io/rb/ibm_watson)
8
8
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
9
9
  [![CLA assistant](https://cla-assistant.io/readme/badge/watson-developer-cloud/ruby-sdk)](https://cla-assistant.io/watson-developer-cloud/ruby-sdk)
10
10
 
11
+ ## Deprecated builds
12
+ [![Build Status](https://travis-ci.org/watson-developer-cloud/ruby-sdk.svg)](https://travis-ci.org/watson-developer-cloud/ruby-sdk)
13
+ [![Build status](https://ci.appveyor.com/api/projects/status/ir3k0ue138o4u67e?svg=true)](https://ci.appveyor.com/project/maxnussbaum/ruby-sdk)
14
+
11
15
  Ruby gem to quickly get started with the various [IBM Watson][wdc] services.
12
16
 
13
17
  <details>
@@ -34,12 +38,24 @@ Ruby gem to quickly get started with the various [IBM Watson][wdc] services.
34
38
 
35
39
  </details>
36
40
 
37
- ## ANNOUNCEMENTS!
38
- ### Personality Insights Deprecation
39
- IBM® will begin sunsetting IBM Watson™ Personality Insights on 1 December 2020. For a period of one year from this date, you will still be able to use Watson Personality Insights. However, as of 1 December 2021, the offering will no longer be available.
41
+ ## Announcements
42
+ ### Support for 2.7 ruby
43
+ To support 2.7 the http gem dependency is updated to 4.4.0. Since it conflicted with the dependency in the ruby-sdk-core that gem was also updated. Using 2.0.2 or above ruby sdk will require a core of 1.1.3 or above.
44
+
45
+ ### Updating endpoint URLs from watsonplatform.net
46
+ Watson API endpoint URLs at watsonplatform.net are changing and will not work after 26 May 2021. Update your calls to use the newer endpoint URLs. For more information, see https://cloud.ibm.com/docs/watson?topic=watson-endpoint-change.
47
+
48
+ ### Personality Insights deprecation
49
+ IBM Watson™ Personality Insights is discontinued. For a period of one year from 1 December 2020, you will still be able to use Watson Personality Insights. However, as of 1 December 2021, the offering will no longer be available.
40
50
 
41
51
  As an alternative, we encourage you to consider migrating to IBM Watson™ [Natural Language Understanding](https://cloud.ibm.com/docs/natural-language-understanding), a service on IBM Cloud® that uses deep learning to extract data and insights from text such as keywords, categories, sentiment, emotion, and syntax to provide insights for your business or industry. For more information, see About Natural Language Understanding.
42
52
 
53
+ ### Visual Recognition deprecation
54
+ IBM Watson™ Visual Recognition is discontinued. Existing instances are supported until 1 December 2021, but as of 7 January 2021, you can't create instances. Any instance that is provisioned on 1 December 2021 will be deleted.
55
+
56
+ ### Compare and Comply deprecation
57
+ IBM Watson™ Compare and Comply is discontinued. Existing instances are supported until 30 November 2021, but as of 1 December 2020, you can't create instances. Any instance that exists on 30 November 2021 will be deleted. Consider migrating to Watson Discovery Premium on IBM Cloud for your Compare and Comply use cases. To start the migration process, visit https://ibm.biz/contact-wdc-premium.
58
+
43
59
  ## Before you begin
44
60
 
45
61
  * You need an [IBM Cloud][ibm-cloud-onboarding] account.
@@ -112,7 +128,7 @@ The file downloaded will be called `ibm-credentials.env`. This is the name the S
112
128
  discovery = DiscoveryV1(version: "2018-08-01")
113
129
  ```
114
130
 
115
- And that's it!
131
+ And that's it!
116
132
 
117
133
  If you're using more than one service at a time in your code and get two different `ibm-credentials.env` files, just put the contents together in one `ibm-credentials.env` file and the SDK will handle assigning credentials to their appropriate services.
118
134
 
@@ -14,7 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
- # IBM OpenAPI SDK Code Generator Version: 3.17.0-8d569e8f-20201030-142059
17
+ # IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
18
18
  #
19
19
  # The IBM Watson&trade; Assistant service combines machine learning, natural language
20
20
  # understanding, and an integrated dialog editor to create conversation flows between your
@@ -29,7 +29,6 @@ require "json"
29
29
  require "ibm_cloud_sdk_core"
30
30
  require_relative "./common.rb"
31
31
 
32
- # Module for the Watson APIs
33
32
  module IBMWatson
34
33
  ##
35
34
  # The Assistant V1 service.
@@ -72,7 +71,7 @@ module IBMWatson
72
71
  #########################
73
72
 
74
73
  ##
75
- # @!method message(workspace_id:, input: nil, intents: nil, entities: nil, alternate_intents: nil, context: nil, output: nil, nodes_visited_details: nil)
74
+ # @!method message(workspace_id:, input: nil, intents: nil, entities: nil, alternate_intents: nil, context: nil, output: nil, user_id: nil, nodes_visited_details: nil)
76
75
  # Get response to user input.
77
76
  # Send user input to a workspace and receive a response.
78
77
  #
@@ -94,10 +93,20 @@ module IBMWatson
94
93
  # from the previous response.
95
94
  # @param output [OutputData] An output object that includes the response to the user, the dialog nodes that
96
95
  # were triggered, and messages from the log.
96
+ # @param user_id [String] A string value that identifies the user who is interacting with the workspace. The
97
+ # client must provide a unique identifier for each individual end user who accesses
98
+ # the application. For user-based plans, this user ID is used to identify unique
99
+ # users for billing purposes. This string cannot contain carriage return, newline,
100
+ # or tab characters. If no value is specified in the input, **user_id** is
101
+ # automatically set to the value of **context.conversation_id**.
102
+ #
103
+ # **Note:** This property is the same as the **user_id** property in the context
104
+ # metadata. If **user_id** is specified in both locations in a message request, the
105
+ # value specified at the root is used.
97
106
  # @param nodes_visited_details [Boolean] Whether to include additional diagnostic information about the dialog nodes that
98
107
  # were visited during processing of the message.
99
108
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
100
- def message(workspace_id:, input: nil, intents: nil, entities: nil, alternate_intents: nil, context: nil, output: nil, nodes_visited_details: nil)
109
+ def message(workspace_id:, input: nil, intents: nil, entities: nil, alternate_intents: nil, context: nil, output: nil, user_id: nil, nodes_visited_details: nil)
101
110
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
102
111
 
103
112
  raise ArgumentError.new("version must be provided") if version.nil?
@@ -118,7 +127,8 @@ module IBMWatson
118
127
  "entities" => entities,
119
128
  "alternate_intents" => alternate_intents,
120
129
  "context" => context,
121
- "output" => output
130
+ "output" => output,
131
+ "user_id" => user_id
122
132
  }
123
133
 
124
134
  method_url = "/v1/workspaces/%s/message" % [ERB::Util.url_encode(workspace_id)]
@@ -134,6 +144,51 @@ module IBMWatson
134
144
  response
135
145
  end
136
146
  #########################
147
+ # Bulk classify
148
+ #########################
149
+
150
+ ##
151
+ # @!method bulk_classify(workspace_id:, input: nil)
152
+ # Identify intents and entities in multiple user utterances.
153
+ # Send multiple user inputs to a workspace in a single request and receive
154
+ # information about the intents and entities recognized in each input. This method
155
+ # is useful for testing and comparing the performance of different workspaces.
156
+ #
157
+ # This method is available only with Enterprise with Data Isolation plans.
158
+ # @param workspace_id [String] Unique identifier of the workspace.
159
+ # @param input [Array[BulkClassifyUtterance]] An array of input utterances to classify.
160
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
161
+ def bulk_classify(workspace_id:, input: nil)
162
+ raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
163
+
164
+ raise ArgumentError.new("version must be provided") if version.nil?
165
+
166
+ headers = {
167
+ }
168
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "bulk_classify")
169
+ headers.merge!(sdk_headers)
170
+
171
+ params = {
172
+ "version" => @version
173
+ }
174
+
175
+ data = {
176
+ "input" => input
177
+ }
178
+
179
+ method_url = "/v1/workspaces/%s/bulk_classify" % [ERB::Util.url_encode(workspace_id)]
180
+
181
+ response = request(
182
+ method: "POST",
183
+ url: method_url,
184
+ headers: headers,
185
+ params: params,
186
+ json: data,
187
+ accept_json: true
188
+ )
189
+ response
190
+ end
191
+ #########################
137
192
  # Workspaces
138
193
  #########################
139
194
 
@@ -2009,27 +2064,34 @@ module IBMWatson
2009
2064
  # If you want to create multiple dialog nodes with a single API call, consider using
2010
2065
  # the **[Update workspace](#update-workspace)** method instead.
2011
2066
  # @param workspace_id [String] Unique identifier of the workspace.
2012
- # @param dialog_node [String] The dialog node ID. This string must conform to the following restrictions:
2013
- # - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
2014
- # characters.
2067
+ # @param dialog_node [String] The unique ID of the dialog node. This is an internal identifier used to refer to
2068
+ # the dialog node from other dialog nodes and in the diagnostic information included
2069
+ # with message responses.
2070
+ #
2071
+ # This string can contain only Unicode alphanumeric, space, underscore, hyphen, and
2072
+ # dot characters.
2015
2073
  # @param description [String] The description of the dialog node. This string cannot contain carriage return,
2016
2074
  # newline, or tab characters.
2017
2075
  # @param conditions [String] The condition that will trigger the dialog node. This string cannot contain
2018
2076
  # carriage return, newline, or tab characters.
2019
- # @param parent [String] The ID of the parent dialog node. This property is omitted if the dialog node has
2020
- # no parent.
2021
- # @param previous_sibling [String] The ID of the previous sibling dialog node. This property is omitted if the dialog
2022
- # node has no previous sibling.
2077
+ # @param parent [String] The unique ID of the parent dialog node. This property is omitted if the dialog
2078
+ # node has no parent.
2079
+ # @param previous_sibling [String] The unique ID of the previous sibling dialog node. This property is omitted if the
2080
+ # dialog node has no previous sibling.
2023
2081
  # @param output [DialogNodeOutput] The output of the dialog node. For more information about how to specify dialog
2024
2082
  # node output, see the
2025
2083
  # [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
2026
2084
  # @param context [DialogNodeContext] The context for the dialog node.
2027
2085
  # @param metadata [Hash] The metadata for the dialog node.
2028
2086
  # @param next_step [DialogNodeNextStep] The next step to execute following this dialog node.
2029
- # @param title [String] The alias used to identify the dialog node. This string must conform to the
2030
- # following restrictions:
2031
- # - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
2032
- # characters.
2087
+ # @param title [String] A human-readable name for the dialog node. If the node is included in
2088
+ # disambiguation, this title is used to populate the **label** property of the
2089
+ # corresponding suggestion in the `suggestion` response type (unless it is
2090
+ # overridden by the **user_label** property). The title is also used to populate the
2091
+ # **topic** property in the `connect_to_agent` response type.
2092
+ #
2093
+ # This string can contain only Unicode alphanumeric, space, underscore, hyphen, and
2094
+ # dot characters.
2033
2095
  # @param type [String] How the dialog node is processed.
2034
2096
  # @param event_name [String] How an `event_handler` node is processed.
2035
2097
  # @param variable [String] The location in the dialog context where output is stored.
@@ -2038,7 +2100,8 @@ module IBMWatson
2038
2100
  # @param digress_out [String] Whether this dialog node can be returned to after a digression.
2039
2101
  # @param digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
2040
2102
  # @param user_label [String] A label that can be displayed externally to describe the purpose of the node to
2041
- # users.
2103
+ # users. If set, this label is used to identify the node in disambiguation responses
2104
+ # (overriding the value of the **title** property).
2042
2105
  # @param disambiguation_opt_out [Boolean] Whether the dialog node should be excluded from disambiguation suggestions. Valid
2043
2106
  # only when **type**=`standard` or `frame`.
2044
2107
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
@@ -2101,7 +2164,7 @@ module IBMWatson
2101
2164
  # Get dialog node.
2102
2165
  # Get information about a dialog node.
2103
2166
  # @param workspace_id [String] Unique identifier of the workspace.
2104
- # @param dialog_node [String] The dialog node ID (for example, `get_order`).
2167
+ # @param dialog_node [String] The dialog node ID (for example, `node_1_1479323581900`).
2105
2168
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
2106
2169
  # the response.
2107
2170
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
@@ -2142,28 +2205,35 @@ module IBMWatson
2142
2205
  # If you want to update multiple dialog nodes with a single API call, consider using
2143
2206
  # the **[Update workspace](#update-workspace)** method instead.
2144
2207
  # @param workspace_id [String] Unique identifier of the workspace.
2145
- # @param dialog_node [String] The dialog node ID (for example, `get_order`).
2146
- # @param new_dialog_node [String] The dialog node ID. This string must conform to the following restrictions:
2147
- # - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
2148
- # characters.
2208
+ # @param dialog_node [String] The dialog node ID (for example, `node_1_1479323581900`).
2209
+ # @param new_dialog_node [String] The unique ID of the dialog node. This is an internal identifier used to refer to
2210
+ # the dialog node from other dialog nodes and in the diagnostic information included
2211
+ # with message responses.
2212
+ #
2213
+ # This string can contain only Unicode alphanumeric, space, underscore, hyphen, and
2214
+ # dot characters.
2149
2215
  # @param new_description [String] The description of the dialog node. This string cannot contain carriage return,
2150
2216
  # newline, or tab characters.
2151
2217
  # @param new_conditions [String] The condition that will trigger the dialog node. This string cannot contain
2152
2218
  # carriage return, newline, or tab characters.
2153
- # @param new_parent [String] The ID of the parent dialog node. This property is omitted if the dialog node has
2154
- # no parent.
2155
- # @param new_previous_sibling [String] The ID of the previous sibling dialog node. This property is omitted if the dialog
2156
- # node has no previous sibling.
2219
+ # @param new_parent [String] The unique ID of the parent dialog node. This property is omitted if the dialog
2220
+ # node has no parent.
2221
+ # @param new_previous_sibling [String] The unique ID of the previous sibling dialog node. This property is omitted if the
2222
+ # dialog node has no previous sibling.
2157
2223
  # @param new_output [DialogNodeOutput] The output of the dialog node. For more information about how to specify dialog
2158
2224
  # node output, see the
2159
2225
  # [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
2160
2226
  # @param new_context [DialogNodeContext] The context for the dialog node.
2161
2227
  # @param new_metadata [Hash] The metadata for the dialog node.
2162
2228
  # @param new_next_step [DialogNodeNextStep] The next step to execute following this dialog node.
2163
- # @param new_title [String] The alias used to identify the dialog node. This string must conform to the
2164
- # following restrictions:
2165
- # - It can contain only Unicode alphanumeric, space, underscore, hyphen, and dot
2166
- # characters.
2229
+ # @param new_title [String] A human-readable name for the dialog node. If the node is included in
2230
+ # disambiguation, this title is used to populate the **label** property of the
2231
+ # corresponding suggestion in the `suggestion` response type (unless it is
2232
+ # overridden by the **user_label** property). The title is also used to populate the
2233
+ # **topic** property in the `connect_to_agent` response type.
2234
+ #
2235
+ # This string can contain only Unicode alphanumeric, space, underscore, hyphen, and
2236
+ # dot characters.
2167
2237
  # @param new_type [String] How the dialog node is processed.
2168
2238
  # @param new_event_name [String] How an `event_handler` node is processed.
2169
2239
  # @param new_variable [String] The location in the dialog context where output is stored.
@@ -2172,7 +2242,8 @@ module IBMWatson
2172
2242
  # @param new_digress_out [String] Whether this dialog node can be returned to after a digression.
2173
2243
  # @param new_digress_out_slots [String] Whether the user can digress to top-level nodes while filling out slots.
2174
2244
  # @param new_user_label [String] A label that can be displayed externally to describe the purpose of the node to
2175
- # users.
2245
+ # users. If set, this label is used to identify the node in disambiguation responses
2246
+ # (overriding the value of the **title** property).
2176
2247
  # @param new_disambiguation_opt_out [Boolean] Whether the dialog node should be excluded from disambiguation suggestions. Valid
2177
2248
  # only when **type**=`standard` or `frame`.
2178
2249
  # @param include_audit [Boolean] Whether to include the audit properties (`created` and `updated` timestamps) in
@@ -2235,7 +2306,7 @@ module IBMWatson
2235
2306
  # Delete dialog node.
2236
2307
  # Delete a dialog node from a workspace.
2237
2308
  # @param workspace_id [String] Unique identifier of the workspace.
2238
- # @param dialog_node [String] The dialog node ID (for example, `get_order`).
2309
+ # @param dialog_node [String] The dialog node ID (for example, `node_1_1479323581900`).
2239
2310
  # @return [nil]
2240
2311
  def delete_dialog_node(workspace_id:, dialog_node:)
2241
2312
  raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
@@ -2272,6 +2343,8 @@ module IBMWatson
2272
2343
  # @!method list_logs(workspace_id:, sort: nil, filter: nil, page_limit: nil, cursor: nil)
2273
2344
  # List log events in a workspace.
2274
2345
  # List the events from the log of a specific workspace.
2346
+ #
2347
+ # This method requires Manager access.
2275
2348
  # @param workspace_id [String] Unique identifier of the workspace.
2276
2349
  # @param sort [String] How to sort the returned log events. You can sort by **request_timestamp**. To
2277
2350
  # reverse the sort order, prefix the parameter value with a minus sign (`-`).
@@ -2368,6 +2441,12 @@ module IBMWatson
2368
2441
  # with a request that passes data. For more information about personal data and
2369
2442
  # customer IDs, see [Information
2370
2443
  # security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
2444
+ #
2445
+ # **Note:** This operation is intended only for deleting data associated with a
2446
+ # single specific customer, not for deleting data associated with multiple customers
2447
+ # or for any other purpose. For more information, see [Labeling and deleting data in
2448
+ # Watson
2449
+ # Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security-gdpr-wa).
2371
2450
  # @param customer_id [String] The customer ID for which all data is to be deleted.
2372
2451
  # @return [nil]
2373
2452
  def delete_user_data(customer_id:)
@@ -2396,50 +2475,5 @@ module IBMWatson
2396
2475
  )
2397
2476
  nil
2398
2477
  end
2399
- #########################
2400
- # bulkClassify
2401
- #########################
2402
-
2403
- ##
2404
- # @!method bulk_classify(workspace_id:, input: nil)
2405
- # Identify intents and entities in multiple user utterances.
2406
- # Send multiple user inputs to a workspace in a single request and receive
2407
- # information about the intents and entities recognized in each input. This method
2408
- # is useful for testing and comparing the performance of different workspaces.
2409
- #
2410
- # This method is available only with Premium plans.
2411
- # @param workspace_id [String] Unique identifier of the workspace.
2412
- # @param input [Array[BulkClassifyUtterance]] An array of input utterances to classify.
2413
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
2414
- def bulk_classify(workspace_id:, input: nil)
2415
- raise ArgumentError.new("workspace_id must be provided") if workspace_id.nil?
2416
-
2417
- raise ArgumentError.new("version must be provided") if version.nil?
2418
-
2419
- headers = {
2420
- }
2421
- sdk_headers = Common.new.get_sdk_headers("conversation", "V1", "bulk_classify")
2422
- headers.merge!(sdk_headers)
2423
-
2424
- params = {
2425
- "version" => @version
2426
- }
2427
-
2428
- data = {
2429
- "input" => input
2430
- }
2431
-
2432
- method_url = "/v1/workspaces/%s/bulk_classify" % [ERB::Util.url_encode(workspace_id)]
2433
-
2434
- response = request(
2435
- method: "POST",
2436
- url: method_url,
2437
- headers: headers,
2438
- params: params,
2439
- json: data,
2440
- accept_json: true
2441
- )
2442
- response
2443
- end
2444
2478
  end
2445
2479
  end
@@ -14,7 +14,7 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
- # IBM OpenAPI SDK Code Generator Version: 3.17.0-8d569e8f-20201030-142059
17
+ # IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
18
18
  #
19
19
  # The IBM Watson&trade; Assistant service combines machine learning, natural language
20
20
  # understanding, and an integrated dialog editor to create conversation flows between your
@@ -29,7 +29,6 @@ require "json"
29
29
  require "ibm_cloud_sdk_core"
30
30
  require_relative "./common.rb"
31
31
 
32
- # Module for the Watson APIs
33
32
  module IBMWatson
34
33
  ##
35
34
  # The Assistant V2 service.
@@ -44,7 +43,7 @@ module IBMWatson
44
43
  #
45
44
  # @param args [Hash] The args to initialize with
46
45
  # @option args version [String] Release date of the API version you want to use. Specify dates in YYYY-MM-DD
47
- # format. The current version is `2020-04-01`.
46
+ # format. The current version is `2020-09-24`.
48
47
  # @option args service_url [String] The base service URL to use when contacting the service.
49
48
  # The base service_url may differ between IBM Cloud regions.
50
49
  # @option args authenticator [Object] The Authenticator instance to be configured for this service.
@@ -158,7 +157,7 @@ module IBMWatson
158
157
  #########################
159
158
 
160
159
  ##
161
- # @!method message(assistant_id:, session_id:, input: nil, context: nil)
160
+ # @!method message(assistant_id:, session_id:, input: nil, context: nil, user_id: nil)
162
161
  # Send user input to assistant (stateful).
163
162
  # Send user input to an assistant and receive a response, with conversation state
164
163
  # (including context data) stored by Watson Assistant for the duration of the
@@ -177,8 +176,18 @@ module IBMWatson
177
176
  #
178
177
  # **Note:** The total size of the context data stored for a stateful session cannot
179
178
  # exceed 100KB.
179
+ # @param user_id [String] A string value that identifies the user who is interacting with the assistant. The
180
+ # client must provide a unique identifier for each individual end user who accesses
181
+ # the application. For user-based plans, this user ID is used to identify unique
182
+ # users for billing purposes. This string cannot contain carriage return, newline,
183
+ # or tab characters. If no value is specified in the input, **user_id** is
184
+ # automatically set to the value of **context.global.session_id**.
185
+ #
186
+ # **Note:** This property is the same as the **user_id** property in the global
187
+ # system context. If **user_id** is specified in both locations, the value specified
188
+ # at the root is used.
180
189
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
181
- def message(assistant_id:, session_id:, input: nil, context: nil)
190
+ def message(assistant_id:, session_id:, input: nil, context: nil, user_id: nil)
182
191
  raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
183
192
 
184
193
  raise ArgumentError.new("session_id must be provided") if session_id.nil?
@@ -196,7 +205,8 @@ module IBMWatson
196
205
 
197
206
  data = {
198
207
  "input" => input,
199
- "context" => context
208
+ "context" => context,
209
+ "user_id" => user_id
200
210
  }
201
211
 
202
212
  method_url = "/v2/assistants/%s/sessions/%s/message" % [ERB::Util.url_encode(assistant_id), ERB::Util.url_encode(session_id)]
@@ -213,7 +223,7 @@ module IBMWatson
213
223
  end
214
224
 
215
225
  ##
216
- # @!method message_stateless(assistant_id:, input: nil, context: nil)
226
+ # @!method message_stateless(assistant_id:, input: nil, context: nil, user_id: nil)
217
227
  # Send user input to assistant (stateless).
218
228
  # Send user input to an assistant and receive a response, with conversation state
219
229
  # (including context data) managed by your application.
@@ -231,8 +241,18 @@ module IBMWatson
231
241
  #
232
242
  # **Note:** The total size of the context data for a stateless session cannot exceed
233
243
  # 250KB.
244
+ # @param user_id [String] A string value that identifies the user who is interacting with the assistant. The
245
+ # client must provide a unique identifier for each individual end user who accesses
246
+ # the application. For user-based plans, this user ID is used to identify unique
247
+ # users for billing purposes. This string cannot contain carriage return, newline,
248
+ # or tab characters. If no value is specified in the input, **user_id** is
249
+ # automatically set to the value of **context.global.session_id**.
250
+ #
251
+ # **Note:** This property is the same as the **user_id** property in the global
252
+ # system context. If **user_id** is specified in both locations in a message
253
+ # request, the value specified at the root is used.
234
254
  # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
235
- def message_stateless(assistant_id:, input: nil, context: nil)
255
+ def message_stateless(assistant_id:, input: nil, context: nil, user_id: nil)
236
256
  raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
237
257
 
238
258
  raise ArgumentError.new("version must be provided") if version.nil?
@@ -248,7 +268,8 @@ module IBMWatson
248
268
 
249
269
  data = {
250
270
  "input" => input,
251
- "context" => context
271
+ "context" => context,
272
+ "user_id" => user_id
252
273
  }
253
274
 
254
275
  method_url = "/v2/assistants/%s/message" % [ERB::Util.url_encode(assistant_id)]
@@ -264,6 +285,53 @@ module IBMWatson
264
285
  response
265
286
  end
266
287
  #########################
288
+ # Bulk classify
289
+ #########################
290
+
291
+ ##
292
+ # @!method bulk_classify(skill_id:, input: nil)
293
+ # Identify intents and entities in multiple user utterances.
294
+ # Send multiple user inputs to a dialog skill in a single request and receive
295
+ # information about the intents and entities recognized in each input. This method
296
+ # is useful for testing and comparing the performance of different skills or skill
297
+ # versions.
298
+ #
299
+ # This method is available only with Enterprise with Data Isolation plans.
300
+ # @param skill_id [String] Unique identifier of the skill. To find the skill ID in the Watson Assistant user
301
+ # interface, open the skill settings and click **API Details**.
302
+ # @param input [Array[BulkClassifyUtterance]] An array of input utterances to classify.
303
+ # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
304
+ def bulk_classify(skill_id:, input: nil)
305
+ raise ArgumentError.new("skill_id must be provided") if skill_id.nil?
306
+
307
+ raise ArgumentError.new("version must be provided") if version.nil?
308
+
309
+ headers = {
310
+ }
311
+ sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "bulk_classify")
312
+ headers.merge!(sdk_headers)
313
+
314
+ params = {
315
+ "version" => @version
316
+ }
317
+
318
+ data = {
319
+ "input" => input
320
+ }
321
+
322
+ method_url = "/v2/skills/%s/workspace/bulk_classify" % [ERB::Util.url_encode(skill_id)]
323
+
324
+ response = request(
325
+ method: "POST",
326
+ url: method_url,
327
+ headers: headers,
328
+ params: params,
329
+ json: data,
330
+ accept_json: true
331
+ )
332
+ response
333
+ end
334
+ #########################
267
335
  # Logs
268
336
  #########################
269
337
 
@@ -272,7 +340,7 @@ module IBMWatson
272
340
  # List log events for an assistant.
273
341
  # List the events from the log of an assistant.
274
342
  #
275
- # This method is available only with Premium plans.
343
+ # This method requires Manager access, and is available only with Enterprise plans.
276
344
  # @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
277
345
  # Assistant user interface, open the assistant settings and click **API Details**.
278
346
  # For information about creating assistants, see the
@@ -331,8 +399,11 @@ module IBMWatson
331
399
  # customer IDs, see [Information
332
400
  # security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
333
401
  #
334
- # This operation is limited to 4 requests per minute. For more information, see
335
- # **Rate limiting**.
402
+ # **Note:** This operation is intended only for deleting data associated with a
403
+ # single specific customer, not for deleting data associated with multiple customers
404
+ # or for any other purpose. For more information, see [Labeling and deleting data in
405
+ # Watson
406
+ # Assistant](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security-gdpr-wa).
336
407
  # @param customer_id [String] The customer ID for which all data is to be deleted.
337
408
  # @return [nil]
338
409
  def delete_user_data(customer_id:)
@@ -361,52 +432,5 @@ module IBMWatson
361
432
  )
362
433
  nil
363
434
  end
364
- #########################
365
- # bulkClassify
366
- #########################
367
-
368
- ##
369
- # @!method bulk_classify(skill_id:, input: nil)
370
- # Identify intents and entities in multiple user utterances.
371
- # Send multiple user inputs to a dialog skill in a single request and receive
372
- # information about the intents and entities recognized in each input. This method
373
- # is useful for testing and comparing the performance of different skills or skill
374
- # versions.
375
- #
376
- # This method is available only with Premium plans.
377
- # @param skill_id [String] Unique identifier of the skill. To find the skill ID in the Watson Assistant user
378
- # interface, open the skill settings and click **API Details**.
379
- # @param input [Array[BulkClassifyUtterance]] An array of input utterances to classify.
380
- # @return [IBMCloudSdkCore::DetailedResponse] A `IBMCloudSdkCore::DetailedResponse` object representing the response.
381
- def bulk_classify(skill_id:, input: nil)
382
- raise ArgumentError.new("skill_id must be provided") if skill_id.nil?
383
-
384
- raise ArgumentError.new("version must be provided") if version.nil?
385
-
386
- headers = {
387
- }
388
- sdk_headers = Common.new.get_sdk_headers("conversation", "V2", "bulk_classify")
389
- headers.merge!(sdk_headers)
390
-
391
- params = {
392
- "version" => @version
393
- }
394
-
395
- data = {
396
- "input" => input
397
- }
398
-
399
- method_url = "/v2/skills/%s/workspace/bulk_classify" % [ERB::Util.url_encode(skill_id)]
400
-
401
- response = request(
402
- method: "POST",
403
- url: method_url,
404
- headers: headers,
405
- params: params,
406
- json: data,
407
- accept_json: true
408
- )
409
- response
410
- end
411
435
  end
412
436
  end