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: 99-SNAPSHOT-a45d89ef-20201209-192237
17
+ # IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-a45d89ef-20201221-115123
18
18
"""
19
19
The IBM Watson™ Assistant service combines machine learning, natural language
20
20
understanding, and an integrated dialog editor to create conversation flows between your
@@ -176,6 +176,66 @@ def message(self,
176
176
response = self .send (request )
177
177
return response
178
178
179
+ #########################
180
+ # Bulk classify
181
+ #########################
182
+
183
+ def bulk_classify (self ,
184
+ workspace_id : str ,
185
+ * ,
186
+ input : List ['BulkClassifyUtterance' ] = None ,
187
+ ** kwargs ) -> DetailedResponse :
188
+ """
189
+ Identify intents and entities in multiple user utterances.
190
+
191
+ Send multiple user inputs to a workspace in a single request and receive
192
+ information about the intents and entities recognized in each input. This method
193
+ is useful for testing and comparing the performance of different workspaces.
194
+ This method is available only with Premium plans.
195
+
196
+ :param str workspace_id: Unique identifier of the workspace.
197
+ :param List[BulkClassifyUtterance] input: (optional) An array of input
198
+ utterances to classify.
199
+ :param dict headers: A `dict` containing the request headers
200
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
201
+ :rtype: DetailedResponse with `dict` result representing a `BulkClassifyResponse` object
202
+ """
203
+
204
+ if workspace_id is None :
205
+ raise ValueError ('workspace_id must be provided' )
206
+ if input is not None :
207
+ input = [convert_model (x ) for x in input ]
208
+ headers = {}
209
+ sdk_headers = get_sdk_headers (service_name = self .DEFAULT_SERVICE_NAME ,
210
+ service_version = 'V1' ,
211
+ operation_id = 'bulk_classify' )
212
+ headers .update (sdk_headers )
213
+
214
+ params = {'version' : self .version }
215
+
216
+ data = {'input' : input }
217
+ data = {k : v for (k , v ) in data .items () if v is not None }
218
+ data = json .dumps (data )
219
+ headers ['content-type' ] = 'application/json'
220
+
221
+ if 'headers' in kwargs :
222
+ headers .update (kwargs .get ('headers' ))
223
+ headers ['Accept' ] = 'application/json'
224
+
225
+ path_param_keys = ['workspace_id' ]
226
+ path_param_values = self .encode_path_vars (workspace_id )
227
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
228
+ url = '/v1/workspaces/{workspace_id}/bulk_classify' .format (
229
+ ** path_param_dict )
230
+ request = self .prepare_request (method = 'POST' ,
231
+ url = url ,
232
+ headers = headers ,
233
+ params = params ,
234
+ data = data )
235
+
236
+ response = self .send (request )
237
+ return response
238
+
179
239
#########################
180
240
# Workspaces
181
241
#########################
@@ -3255,66 +3315,6 @@ def delete_user_data(self, customer_id: str, **kwargs) -> DetailedResponse:
3255
3315
response = self .send (request )
3256
3316
return response
3257
3317
3258
- #########################
3259
- # bulkClassify
3260
- #########################
3261
-
3262
- def bulk_classify (self ,
3263
- workspace_id : str ,
3264
- * ,
3265
- input : List ['BulkClassifyUtterance' ] = None ,
3266
- ** kwargs ) -> DetailedResponse :
3267
- """
3268
- Identify intents and entities in multiple user utterances.
3269
-
3270
- Send multiple user inputs to a workspace in a single request and receive
3271
- information about the intents and entities recognized in each input. This method
3272
- is useful for testing and comparing the performance of different workspaces.
3273
- This method is available only with Premium plans.
3274
-
3275
- :param str workspace_id: Unique identifier of the workspace.
3276
- :param List[BulkClassifyUtterance] input: (optional) An array of input
3277
- utterances to classify.
3278
- :param dict headers: A `dict` containing the request headers
3279
- :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3280
- :rtype: DetailedResponse with `dict` result representing a `BulkClassifyResponse` object
3281
- """
3282
-
3283
- if workspace_id is None :
3284
- raise ValueError ('workspace_id must be provided' )
3285
- if input is not None :
3286
- input = [convert_model (x ) for x in input ]
3287
- headers = {}
3288
- sdk_headers = get_sdk_headers (service_name = self .DEFAULT_SERVICE_NAME ,
3289
- service_version = 'V1' ,
3290
- operation_id = 'bulk_classify' )
3291
- headers .update (sdk_headers )
3292
-
3293
- params = {'version' : self .version }
3294
-
3295
- data = {'input' : input }
3296
- data = {k : v for (k , v ) in data .items () if v is not None }
3297
- data = json .dumps (data )
3298
- headers ['content-type' ] = 'application/json'
3299
-
3300
- if 'headers' in kwargs :
3301
- headers .update (kwargs .get ('headers' ))
3302
- headers ['Accept' ] = 'application/json'
3303
-
3304
- path_param_keys = ['workspace_id' ]
3305
- path_param_values = self .encode_path_vars (workspace_id )
3306
- path_param_dict = dict (zip (path_param_keys , path_param_values ))
3307
- url = '/v1/workspaces/{workspace_id}/bulk_classify' .format (
3308
- ** path_param_dict )
3309
- request = self .prepare_request (method = 'POST' ,
3310
- url = url ,
3311
- headers = headers ,
3312
- params = params ,
3313
- data = data )
3314
-
3315
- response = self .send (request )
3316
- return response
3317
-
3318
3318
3319
3319
class ListWorkspacesEnums :
3320
3320
"""
@@ -3447,6 +3447,60 @@ class Sort(str, Enum):
3447
3447
##############################################################################
3448
3448
3449
3449
3450
+ class AgentAvailabilityMessage ():
3451
+ """
3452
+ AgentAvailabilityMessage.
3453
+
3454
+ :attr str message: (optional) The text of the message.
3455
+ """
3456
+
3457
+ def __init__ (self , * , message : str = None ) -> None :
3458
+ """
3459
+ Initialize a AgentAvailabilityMessage object.
3460
+
3461
+ :param str message: (optional) The text of the message.
3462
+ """
3463
+ self .message = message
3464
+
3465
+ @classmethod
3466
+ def from_dict (cls , _dict : Dict ) -> 'AgentAvailabilityMessage' :
3467
+ """Initialize a AgentAvailabilityMessage object from a json dictionary."""
3468
+ args = {}
3469
+ if 'message' in _dict :
3470
+ args ['message' ] = _dict .get ('message' )
3471
+ return cls (** args )
3472
+
3473
+ @classmethod
3474
+ def _from_dict (cls , _dict ):
3475
+ """Initialize a AgentAvailabilityMessage object from a json dictionary."""
3476
+ return cls .from_dict (_dict )
3477
+
3478
+ def to_dict (self ) -> Dict :
3479
+ """Return a json dictionary representing this model."""
3480
+ _dict = {}
3481
+ if hasattr (self , 'message' ) and self .message is not None :
3482
+ _dict ['message' ] = self .message
3483
+ return _dict
3484
+
3485
+ def _to_dict (self ):
3486
+ """Return a json dictionary representing this model."""
3487
+ return self .to_dict ()
3488
+
3489
+ def __str__ (self ) -> str :
3490
+ """Return a `str` version of this AgentAvailabilityMessage object."""
3491
+ return json .dumps (self .to_dict (), indent = 2 )
3492
+
3493
+ def __eq__ (self , other : 'AgentAvailabilityMessage' ) -> bool :
3494
+ """Return `true` when self and other are equal, false otherwise."""
3495
+ if not isinstance (other , self .__class__ ):
3496
+ return False
3497
+ return self .__dict__ == other .__dict__
3498
+
3499
+ def __ne__ (self , other : 'AgentAvailabilityMessage' ) -> bool :
3500
+ """Return `true` when self and other are not equal, false otherwise."""
3501
+ return not self == other
3502
+
3503
+
3450
3504
class BulkClassifyOutput ():
3451
3505
"""
3452
3506
BulkClassifyOutput.
@@ -7705,10 +7759,8 @@ class RuntimeEntity():
7705
7759
the entity, as defined by the entity pattern.
7706
7760
:attr RuntimeEntityInterpretation interpretation: (optional) An object
7707
7761
containing detailed information about the entity recognized in the user input.
7708
- This property is included only if the new system entities are enabled for the
7709
- workspace.
7710
- For more information about how the new system entities are interpreted, see the
7711
- [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities).
7762
+ For more information about how system entities are interpreted, see the
7763
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-system-entities).
7712
7764
:attr List[RuntimeEntityAlternative] alternatives: (optional) An array of
7713
7765
possible alternative values that the user might have intended instead of the
7714
7766
value returned in the **value** property. This property is returned only for
@@ -7746,11 +7798,9 @@ def __init__(self,
7746
7798
for the entity, as defined by the entity pattern.
7747
7799
:param RuntimeEntityInterpretation interpretation: (optional) An object
7748
7800
containing detailed information about the entity recognized in the user
7749
- input. This property is included only if the new system entities are
7750
- enabled for the workspace.
7751
- For more information about how the new system entities are interpreted, see
7752
- the
7753
- [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities).
7801
+ input.
7802
+ For more information about how system entities are interpreted, see the
7803
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-system-entities).
7754
7804
:param List[RuntimeEntityAlternative] alternatives: (optional) An array of
7755
7805
possible alternative values that the user might have intended instead of
7756
7806
the value returned in the **value** property. This property is returned
@@ -9772,12 +9822,12 @@ class DialogNodeOutputGenericDialogNodeOutputResponseTypeConnectToAgent(
9772
9822
specified response type must be supported by the client application or channel.
9773
9823
:attr str message_to_human_agent: (optional) An optional message to be sent to
9774
9824
the human agent who will be taking over the conversation.
9775
- :attr str agent_available: (optional) An optional message to be displayed to the
9776
- user to indicate that the conversation will be transferred to the next available
9777
- agent.
9778
- :attr str agent_unavailable: (optional) An optional message to be displayed to
9779
- the user to indicate that no online agent is available to take over the
9780
- conversation.
9825
+ :attr AgentAvailabilityMessage agent_available: (optional) An optional message
9826
+ to be displayed to the user to indicate that the conversation will be
9827
+ transferred to the next available agent.
9828
+ :attr AgentAvailabilityMessage agent_unavailable: (optional) An optional message
9829
+ to be displayed to the user to indicate that no online agent is available to
9830
+ take over the conversation.
9781
9831
:attr DialogNodeOutputConnectToAgentTransferInfo transfer_info: (optional)
9782
9832
Routing or other contextual information to be used by target service desk
9783
9833
systems.
@@ -9788,8 +9838,8 @@ def __init__(
9788
9838
response_type : str ,
9789
9839
* ,
9790
9840
message_to_human_agent : str = None ,
9791
- agent_available : str = None ,
9792
- agent_unavailable : str = None ,
9841
+ agent_available : 'AgentAvailabilityMessage' = None ,
9842
+ agent_unavailable : 'AgentAvailabilityMessage' = None ,
9793
9843
transfer_info : 'DialogNodeOutputConnectToAgentTransferInfo' = None
9794
9844
) -> None :
9795
9845
"""
@@ -9800,12 +9850,12 @@ def __init__(
9800
9850
channel.
9801
9851
:param str message_to_human_agent: (optional) An optional message to be
9802
9852
sent to the human agent who will be taking over the conversation.
9803
- :param str agent_available: (optional) An optional message to be displayed
9804
- to the user to indicate that the conversation will be transferred to the
9805
- next available agent.
9806
- :param str agent_unavailable: (optional) An optional message to be
9807
- displayed to the user to indicate that no online agent is available to take
9808
- over the conversation.
9853
+ :param AgentAvailabilityMessage agent_available: (optional) An optional
9854
+ message to be displayed to the user to indicate that the conversation will
9855
+ be transferred to the next available agent.
9856
+ :param AgentAvailabilityMessage agent_unavailable: (optional) An optional
9857
+ message to be displayed to the user to indicate that no online agent is
9858
+ available to take over the conversation.
9809
9859
:param DialogNodeOutputConnectToAgentTransferInfo transfer_info: (optional)
9810
9860
Routing or other contextual information to be used by target service desk
9811
9861
systems.
@@ -9832,9 +9882,11 @@ def from_dict(
9832
9882
if 'message_to_human_agent' in _dict :
9833
9883
args ['message_to_human_agent' ] = _dict .get ('message_to_human_agent' )
9834
9884
if 'agent_available' in _dict :
9835
- args ['agent_available' ] = _dict .get ('agent_available' )
9885
+ args ['agent_available' ] = AgentAvailabilityMessage .from_dict (
9886
+ _dict .get ('agent_available' ))
9836
9887
if 'agent_unavailable' in _dict :
9837
- args ['agent_unavailable' ] = _dict .get ('agent_unavailable' )
9888
+ args ['agent_unavailable' ] = AgentAvailabilityMessage .from_dict (
9889
+ _dict .get ('agent_unavailable' ))
9838
9890
if 'transfer_info' in _dict :
9839
9891
args [
9840
9892
'transfer_info' ] = DialogNodeOutputConnectToAgentTransferInfo .from_dict (
@@ -9856,10 +9908,10 @@ def to_dict(self) -> Dict:
9856
9908
_dict ['message_to_human_agent' ] = self .message_to_human_agent
9857
9909
if hasattr (self ,
9858
9910
'agent_available' ) and self .agent_available is not None :
9859
- _dict ['agent_available' ] = self .agent_available
9911
+ _dict ['agent_available' ] = self .agent_available . to_dict ()
9860
9912
if hasattr (self ,
9861
9913
'agent_unavailable' ) and self .agent_unavailable is not None :
9862
- _dict ['agent_unavailable' ] = self .agent_unavailable
9914
+ _dict ['agent_unavailable' ] = self .agent_unavailable . to_dict ()
9863
9915
if hasattr (self , 'transfer_info' ) and self .transfer_info is not None :
9864
9916
_dict ['transfer_info' ] = self .transfer_info .to_dict ()
9865
9917
return _dict
@@ -10523,12 +10575,12 @@ class RuntimeResponseGenericRuntimeResponseTypeConnectToAgent(
10523
10575
specified response type must be supported by the client application or channel.
10524
10576
:attr str message_to_human_agent: (optional) A message to be sent to the human
10525
10577
agent who will be taking over the conversation.
10526
- :attr str agent_available: (optional) An optional message to be displayed to the
10527
- user to indicate that the conversation will be transferred to the next available
10528
- agent.
10529
- :attr str agent_unavailable: (optional) An optional message to be displayed to
10530
- the user to indicate that no online agent is available to take over the
10531
- conversation.
10578
+ :attr AgentAvailabilityMessage agent_available: (optional) An optional message
10579
+ to be displayed to the user to indicate that the conversation will be
10580
+ transferred to the next available agent.
10581
+ :attr AgentAvailabilityMessage agent_unavailable: (optional) An optional message
10582
+ to be displayed to the user to indicate that no online agent is available to
10583
+ take over the conversation.
10532
10584
:attr DialogNodeOutputConnectToAgentTransferInfo transfer_info: (optional)
10533
10585
Routing or other contextual information to be used by target service desk
10534
10586
systems.
@@ -10545,8 +10597,8 @@ def __init__(
10545
10597
response_type : str ,
10546
10598
* ,
10547
10599
message_to_human_agent : str = None ,
10548
- agent_available : str = None ,
10549
- agent_unavailable : str = None ,
10600
+ agent_available : 'AgentAvailabilityMessage' = None ,
10601
+ agent_unavailable : 'AgentAvailabilityMessage' = None ,
10550
10602
transfer_info : 'DialogNodeOutputConnectToAgentTransferInfo' = None ,
10551
10603
topic : str = None ,
10552
10604
dialog_node : str = None ) -> None :
@@ -10558,12 +10610,12 @@ def __init__(
10558
10610
channel.
10559
10611
:param str message_to_human_agent: (optional) A message to be sent to the
10560
10612
human agent who will be taking over the conversation.
10561
- :param str agent_available: (optional) An optional message to be displayed
10562
- to the user to indicate that the conversation will be transferred to the
10563
- next available agent.
10564
- :param str agent_unavailable: (optional) An optional message to be
10565
- displayed to the user to indicate that no online agent is available to take
10566
- over the conversation.
10613
+ :param AgentAvailabilityMessage agent_available: (optional) An optional
10614
+ message to be displayed to the user to indicate that the conversation will
10615
+ be transferred to the next available agent.
10616
+ :param AgentAvailabilityMessage agent_unavailable: (optional) An optional
10617
+ message to be displayed to the user to indicate that no online agent is
10618
+ available to take over the conversation.
10567
10619
:param DialogNodeOutputConnectToAgentTransferInfo transfer_info: (optional)
10568
10620
Routing or other contextual information to be used by target service desk
10569
10621
systems.
@@ -10598,9 +10650,11 @@ def from_dict(
10598
10650
if 'message_to_human_agent' in _dict :
10599
10651
args ['message_to_human_agent' ] = _dict .get ('message_to_human_agent' )
10600
10652
if 'agent_available' in _dict :
10601
- args ['agent_available' ] = _dict .get ('agent_available' )
10653
+ args ['agent_available' ] = AgentAvailabilityMessage .from_dict (
10654
+ _dict .get ('agent_available' ))
10602
10655
if 'agent_unavailable' in _dict :
10603
- args ['agent_unavailable' ] = _dict .get ('agent_unavailable' )
10656
+ args ['agent_unavailable' ] = AgentAvailabilityMessage .from_dict (
10657
+ _dict .get ('agent_unavailable' ))
10604
10658
if 'transfer_info' in _dict :
10605
10659
args [
10606
10660
'transfer_info' ] = DialogNodeOutputConnectToAgentTransferInfo .from_dict (
@@ -10626,10 +10680,10 @@ def to_dict(self) -> Dict:
10626
10680
_dict ['message_to_human_agent' ] = self .message_to_human_agent
10627
10681
if hasattr (self ,
10628
10682
'agent_available' ) and self .agent_available is not None :
10629
- _dict ['agent_available' ] = self .agent_available
10683
+ _dict ['agent_available' ] = self .agent_available . to_dict ()
10630
10684
if hasattr (self ,
10631
10685
'agent_unavailable' ) and self .agent_unavailable is not None :
10632
- _dict ['agent_unavailable' ] = self .agent_unavailable
10686
+ _dict ['agent_unavailable' ] = self .agent_unavailable . to_dict ()
10633
10687
if hasattr (self , 'transfer_info' ) and self .transfer_info is not None :
10634
10688
_dict ['transfer_info' ] = self .transfer_info .to_dict ()
10635
10689
if hasattr (self , 'topic' ) and self .topic is not None :
0 commit comments