Skip to content

Commit 0f834b1

Browse files
authored
Merge pull request #116 from watson-developer-cloud/release-1-2021
feat: Release 1 2021
2 parents c5963c9 + e513353 commit 0f834b1

24 files changed

Lines changed: 7449 additions & 309 deletions

lib/ibm_watson/assistant_v1.rb

Lines changed: 111 additions & 77 deletions
Large diffs are not rendered by default.

lib/ibm_watson/assistant_v2.rb

Lines changed: 83 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
# IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
17+
# IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
1818
#
1919
# The IBM Watson™ Assistant service combines machine learning, natural language
2020
# understanding, and an integrated dialog editor to create conversation flows between your
@@ -29,7 +29,6 @@
2929
require "ibm_cloud_sdk_core"
3030
require_relative "./common.rb"
3131

32-
# Module for the Watson APIs
3332
module IBMWatson
3433
##
3534
# The Assistant V2 service.
@@ -44,7 +43,7 @@ class AssistantV2 < IBMCloudSdkCore::BaseService
4443
#
4544
# @param args [Hash] The args to initialize with
4645
# @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`.
4847
# @option args service_url [String] The base service URL to use when contacting the service.
4948
# The base service_url may differ between IBM Cloud regions.
5049
# @option args authenticator [Object] The Authenticator instance to be configured for this service.
@@ -158,7 +157,7 @@ def delete_session(assistant_id:, session_id:)
158157
#########################
159158

160159
##
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)
162161
# Send user input to assistant (stateful).
163162
# Send user input to an assistant and receive a response, with conversation state
164163
# (including context data) stored by Watson Assistant for the duration of the
@@ -177,8 +176,18 @@ def delete_session(assistant_id:, session_id:)
177176
#
178177
# **Note:** The total size of the context data stored for a stateful session cannot
179178
# 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.
180189
# @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)
182191
raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
183192

184193
raise ArgumentError.new("session_id must be provided") if session_id.nil?
@@ -196,7 +205,8 @@ def message(assistant_id:, session_id:, input: nil, context: nil)
196205

197206
data = {
198207
"input" => input,
199-
"context" => context
208+
"context" => context,
209+
"user_id" => user_id
200210
}
201211

202212
method_url = "/v2/assistants/%s/sessions/%s/message" % [ERB::Util.url_encode(assistant_id), ERB::Util.url_encode(session_id)]
@@ -213,7 +223,7 @@ def message(assistant_id:, session_id:, input: nil, context: nil)
213223
end
214224

215225
##
216-
# @!method message_stateless(assistant_id:, input: nil, context: nil)
226+
# @!method message_stateless(assistant_id:, input: nil, context: nil, user_id: nil)
217227
# Send user input to assistant (stateless).
218228
# Send user input to an assistant and receive a response, with conversation state
219229
# (including context data) managed by your application.
@@ -231,8 +241,18 @@ def message(assistant_id:, session_id:, input: nil, context: nil)
231241
#
232242
# **Note:** The total size of the context data for a stateless session cannot exceed
233243
# 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.
234254
# @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)
236256
raise ArgumentError.new("assistant_id must be provided") if assistant_id.nil?
237257

238258
raise ArgumentError.new("version must be provided") if version.nil?
@@ -248,7 +268,8 @@ def message_stateless(assistant_id:, input: nil, context: nil)
248268

249269
data = {
250270
"input" => input,
251-
"context" => context
271+
"context" => context,
272+
"user_id" => user_id
252273
}
253274

254275
method_url = "/v2/assistants/%s/message" % [ERB::Util.url_encode(assistant_id)]
@@ -264,6 +285,53 @@ def message_stateless(assistant_id:, input: nil, context: nil)
264285
response
265286
end
266287
#########################
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+
#########################
267335
# Logs
268336
#########################
269337

@@ -272,7 +340,7 @@ def message_stateless(assistant_id:, input: nil, context: nil)
272340
# List log events for an assistant.
273341
# List the events from the log of an assistant.
274342
#
275-
# This method is available only with Premium plans.
343+
# This method requires Manager access, and is available only with Enterprise plans.
276344
# @param assistant_id [String] Unique identifier of the assistant. To find the assistant ID in the Watson
277345
# Assistant user interface, open the assistant settings and click **API Details**.
278346
# For information about creating assistants, see the
@@ -331,8 +399,11 @@ def list_logs(assistant_id:, sort: nil, filter: nil, page_limit: nil, cursor: ni
331399
# customer IDs, see [Information
332400
# security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
333401
#
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).
336407
# @param customer_id [String] The customer ID for which all data is to be deleted.
337408
# @return [nil]
338409
def delete_user_data(customer_id:)
@@ -361,52 +432,5 @@ def delete_user_data(customer_id:)
361432
)
362433
nil
363434
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
411435
end
412436
end

lib/ibm_watson/compare_comply_v1.rb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,25 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
# IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
17+
# IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
1818
#
19-
# IBM Watson&trade; Compare and Comply analyzes governing documents to provide details
20-
# about critical aspects of the documents.
19+
# IBM Watson&trade; Compare and Comply is discontinued. Existing instances are supported
20+
# until 30 November 2021, but as of 1 December 2020, you can't create instances. Any
21+
# instance that exists on 30 November 2021 will be deleted. Consider migrating to Watson
22+
# Discovery Premium on IBM Cloud for your Compare and Comply use cases. To start the
23+
# migration process, visit
24+
# [https://ibm.biz/contact-wdc-premium](https://ibm.biz/contact-wdc-premium).
25+
# {: deprecated}
26+
#
27+
# Compare and Comply analyzes governing documents to provide details about critical
28+
# aspects of the documents.
2129

2230
require "concurrent"
2331
require "erb"
2432
require "json"
2533
require "ibm_cloud_sdk_core"
2634
require_relative "./common.rb"
2735

28-
# Module for the Watson APIs
2936
module IBMWatson
3037
##
3138
# The Compare Comply V1 service.

lib/ibm_watson/discovery_v1.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
# IBM OpenAPI SDK Code Generator Version: 3.19.0-be3b4618-20201113-200858
17+
# IBM OpenAPI SDK Code Generator Version: 3.31.0-902c9336-20210504-161156
1818
#
1919
# IBM Watson&trade; Discovery is a cognitive search and content analytics engine that
2020
# you can add to applications to identify patterns, trends and actionable insights to
@@ -28,7 +28,6 @@
2828
require "ibm_cloud_sdk_core"
2929
require_relative "./common.rb"
3030

31-
# Module for the Watson APIs
3231
module IBMWatson
3332
##
3433
# The Discovery V1 service.
@@ -1430,7 +1429,7 @@ def delete_document(environment_id:, collection_id:, document_id:)
14301429
# parameter.
14311430
# @param spelling_suggestions [Boolean] When `true` and the **natural_language_query** parameter is used, the
14321431
# **natural_languge_query** parameter is spell checked. The most likely correction
1433-
# is retunred in the **suggested_query** field of the response (if one exists).
1432+
# is returned in the **suggested_query** field of the response (if one exists).
14341433
#
14351434
# **Important:** this parameter is only valid when using the Cloud Pak version of
14361435
# Discovery.

0 commit comments

Comments
 (0)