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
2929require "ibm_cloud_sdk_core"
3030require_relative "./common.rb"
3131
32- # Module for the Watson APIs
3332module 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
412436end
0 commit comments