1
1
# coding: utf-8
2
2
3
- # (C) Copyright IBM Corp. 2019, 2020.
3
+ # (C) Copyright IBM Corp. 2020.
4
4
#
5
5
# Licensed under the Apache License, Version 2.0 (the "License");
6
6
# you may not use this file except in compliance with the License.
27
27
from datetime import datetime
28
28
from enum import Enum
29
29
from ibm_cloud_sdk_core import BaseService
30
+ from ibm_cloud_sdk_core import DetailedResponse
30
31
from ibm_cloud_sdk_core import datetime_to_string , string_to_datetime
31
- from ibm_cloud_sdk_core import get_authenticator_from_environment
32
+ from ibm_cloud_sdk_core . get_authenticator import get_authenticator_from_environment
32
33
from typing import Dict
33
34
from typing import List
34
35
@@ -98,7 +99,7 @@ def message(self,
98
99
**Important:** This method has been superseded by the new v2 runtime API. The v2
99
100
API offers significant advantages, including ease of deployment, automatic state
100
101
management, versioning, and search capabilities. For more information, see the
101
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-api-overview).
102
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-api-overview).
102
103
There is no rate limit for this operation.
103
104
104
105
:param str workspace_id: Unique identifier of the workspace.
@@ -2598,7 +2599,7 @@ def create_dialog_node(self,
2598
2599
sibling.
2599
2600
:param DialogNodeOutput output: (optional) The output of the dialog node.
2600
2601
For more information about how to specify dialog node output, see the
2601
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-dialog-overview#dialog-overview-responses).
2602
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
2602
2603
:param dict context: (optional) The context for the dialog node.
2603
2604
:param dict metadata: (optional) The metadata for the dialog node.
2604
2605
:param DialogNodeNextStep next_step: (optional) The next step to execute
@@ -2783,7 +2784,7 @@ def update_dialog_node(self,
2783
2784
sibling.
2784
2785
:param DialogNodeOutput new_output: (optional) The output of the dialog
2785
2786
node. For more information about how to specify dialog node output, see the
2786
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-dialog-overview#dialog-overview-responses).
2787
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
2787
2788
:param dict new_context: (optional) The context for the dialog node.
2788
2789
:param dict new_metadata: (optional) The metadata for the dialog node.
2789
2790
:param DialogNodeNextStep new_next_step: (optional) The next step to
@@ -2937,7 +2938,7 @@ def list_logs(self,
2937
2938
parameter value with a minus sign (`-`).
2938
2939
:param str filter: (optional) A cacheable parameter that limits the results
2939
2940
to those matching the specified filter. For more information, see the
2940
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-filter-reference#filter-reference).
2941
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
2941
2942
:param int page_limit: (optional) The number of records to return in each
2942
2943
page of results.
2943
2944
:param str cursor: (optional) A token identifying the page of results to
@@ -2996,7 +2997,7 @@ def list_all_logs(self,
2996
2997
includes a value for `language`, as well as a value for
2997
2998
`request.context.system.assistant_id`, `workspace_id`, or
2998
2999
`request.context.metadata.deployment`. For more information, see the
2999
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-filter-reference#filter-reference).
3000
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-filter-reference#filter-reference).
3000
3001
:param str sort: (optional) How to sort the returned log events. You can
3001
3002
sort by **request_timestamp**. To reverse the sort order, prefix the
3002
3003
parameter value with a minus sign (`-`).
@@ -3051,7 +3052,7 @@ def delete_user_data(self, customer_id: str,
3051
3052
You associate a customer ID with data by passing the `X-Watson-Metadata` header
3052
3053
with a request that passes data. For more information about personal data and
3053
3054
customer IDs, see [Information
3054
- security](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-information-security#information-security).
3055
+ security](https://cloud.ibm.com/docs/assistant?topic=assistant-information-security#information-security).
3055
3056
This operation is limited to 4 requests per minute. For more information, see
3056
3057
**Rate limiting**.
3057
3058
@@ -3805,7 +3806,7 @@ class CreateValue():
3805
3806
A value can specify either synonyms or patterns (depending on the value type),
3806
3807
but not both. A pattern is a regular expression; for more information about how
3807
3808
to specify a pattern, see the
3808
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-entities#entities-create-dictionary-based).
3809
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#entities-create-dictionary-based).
3809
3810
:attr datetime created: (optional) The timestamp for creation of the object.
3810
3811
:attr datetime updated: (optional) The timestamp for the most recent update to
3811
3812
the object.
@@ -3839,7 +3840,7 @@ def __init__(self,
3839
3840
value. A value can specify either synonyms or patterns (depending on the
3840
3841
value type), but not both. A pattern is a regular expression; for more
3841
3842
information about how to specify a pattern, see the
3842
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-entities#entities-create-dictionary-based).
3843
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#entities-create-dictionary-based).
3843
3844
:param datetime created: (optional) The timestamp for creation of the
3844
3845
object.
3845
3846
:param datetime updated: (optional) The timestamp for the most recent
@@ -3953,7 +3954,7 @@ class DialogNode():
3953
3954
node. This property is omitted if the dialog node has no previous sibling.
3954
3955
:attr DialogNodeOutput output: (optional) The output of the dialog node. For
3955
3956
more information about how to specify dialog node output, see the
3956
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-dialog-overview#dialog-overview-responses).
3957
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
3957
3958
:attr dict context: (optional) The context for the dialog node.
3958
3959
:attr dict metadata: (optional) The metadata for the dialog node.
3959
3960
:attr DialogNodeNextStep next_step: (optional) The next step to execute
@@ -4027,7 +4028,7 @@ def __init__(self,
4027
4028
sibling.
4028
4029
:param DialogNodeOutput output: (optional) The output of the dialog node.
4029
4030
For more information about how to specify dialog node output, see the
4030
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-dialog-overview#dialog-overview-responses).
4031
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
4031
4032
:param dict context: (optional) The context for the dialog node.
4032
4033
:param dict metadata: (optional) The metadata for the dialog node.
4033
4034
:param DialogNodeNextStep next_step: (optional) The next step to execute
@@ -4645,7 +4646,7 @@ class DialogNodeOutput():
4645
4646
"""
4646
4647
The output of the dialog node. For more information about how to specify dialog node
4647
4648
output, see the
4648
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-dialog-overview#dialog-overview-responses).
4649
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-overview#dialog-overview-responses).
4649
4650
4650
4651
:attr List[DialogNodeOutputGeneric] generic: (optional) An array of objects
4651
4652
describing the output defined for the dialog node.
@@ -7914,6 +7915,16 @@ class RuntimeEntity():
7914
7915
:attr dict metadata: (optional) Any metadata for the entity.
7915
7916
:attr List[CaptureGroup] groups: (optional) The recognized capture groups for
7916
7917
the entity, as defined by the entity pattern.
7918
+ :attr RuntimeEntityInterpretation interpretation: (optional) An object
7919
+ containing detailed information about the entity recognized in the user input.
7920
+ This property is included only if the new system entities are enabled for the
7921
+ workspace.
7922
+ For more information about how the new system entities are interpreted, see the
7923
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-beta-system-entities).
7924
+ :attr RuntimeEntityRole role: (optional) An object describing the role played by
7925
+ a system entity that is specifies the beginning or end of a range recognized in
7926
+ the user input. This property is included only if the new system entities are
7927
+ enabled for the workspace.
7917
7928
"""
7918
7929
7919
7930
def __init__ (self ,
@@ -7923,7 +7934,9 @@ def __init__(self,
7923
7934
* ,
7924
7935
confidence : float = None ,
7925
7936
metadata : dict = None ,
7926
- groups : List ['CaptureGroup' ] = None ) -> None :
7937
+ groups : List ['CaptureGroup' ] = None ,
7938
+ interpretation : 'RuntimeEntityInterpretation' = None ,
7939
+ role : 'RuntimeEntityRole' = None ) -> None :
7927
7940
"""
7928
7941
Initialize a RuntimeEntity object.
7929
7942
@@ -9058,7 +9071,7 @@ class Value():
9058
9071
A value can specify either synonyms or patterns (depending on the value type),
9059
9072
but not both. A pattern is a regular expression; for more information about how
9060
9073
to specify a pattern, see the
9061
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-entities#entities-create-dictionary-based).
9074
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#entities-create-dictionary-based).
9062
9075
:attr datetime created: (optional) The timestamp for creation of the object.
9063
9076
:attr datetime updated: (optional) The timestamp for the most recent update to
9064
9077
the object.
@@ -9092,7 +9105,7 @@ def __init__(self,
9092
9105
value. A value can specify either synonyms or patterns (depending on the
9093
9106
value type), but not both. A pattern is a regular expression; for more
9094
9107
information about how to specify a pattern, see the
9095
- [documentation](https://cloud.ibm.com/docs/services/ assistant?topic=assistant-entities#entities-create-dictionary-based).
9108
+ [documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-entities#entities-create-dictionary-based).
9096
9109
:param datetime created: (optional) The timestamp for creation of the
9097
9110
object.
9098
9111
:param datetime updated: (optional) The timestamp for the most recent
@@ -9764,16 +9777,20 @@ class WorkspaceSystemSettings():
9764
9777
settings related to the disambiguation feature.
9765
9778
**Note:** This feature is available only to Plus and Premium users.
9766
9779
:attr dict human_agent_assist: (optional) For internal use only.
9780
+ :attr WorkspaceSystemSettingsSystemEntities system_entities: (optional)
9781
+ Workspace settings related to the behavior of system entities.
9767
9782
:attr WorkspaceSystemSettingsOffTopic off_topic: (optional) Workspace settings
9768
9783
related to detection of irrelevant input.
9769
9784
"""
9770
9785
9771
- def __init__ (self ,
9772
- * ,
9773
- tooling : 'WorkspaceSystemSettingsTooling' = None ,
9774
- disambiguation : 'WorkspaceSystemSettingsDisambiguation' = None ,
9775
- human_agent_assist : dict = None ,
9776
- off_topic : 'WorkspaceSystemSettingsOffTopic' = None ) -> None :
9786
+ def __init__ (
9787
+ self ,
9788
+ * ,
9789
+ tooling : 'WorkspaceSystemSettingsTooling' = None ,
9790
+ disambiguation : 'WorkspaceSystemSettingsDisambiguation' = None ,
9791
+ human_agent_assist : dict = None ,
9792
+ system_entities : 'WorkspaceSystemSettingsSystemEntities' = None ,
9793
+ off_topic : 'WorkspaceSystemSettingsOffTopic' = None ) -> None :
9777
9794
"""
9778
9795
Initialize a WorkspaceSystemSettings object.
9779
9796
@@ -9783,20 +9800,24 @@ def __init__(self,
9783
9800
Workspace settings related to the disambiguation feature.
9784
9801
**Note:** This feature is available only to Plus and Premium users.
9785
9802
:param dict human_agent_assist: (optional) For internal use only.
9803
+ :param WorkspaceSystemSettingsSystemEntities system_entities: (optional)
9804
+ Workspace settings related to the behavior of system entities.
9786
9805
:param WorkspaceSystemSettingsOffTopic off_topic: (optional) Workspace
9787
9806
settings related to detection of irrelevant input.
9788
9807
"""
9789
9808
self .tooling = tooling
9790
9809
self .disambiguation = disambiguation
9791
9810
self .human_agent_assist = human_agent_assist
9811
+ self .system_entities = system_entities
9792
9812
self .off_topic = off_topic
9793
9813
9794
9814
@classmethod
9795
9815
def from_dict (cls , _dict : Dict ) -> 'WorkspaceSystemSettings' :
9796
9816
"""Initialize a WorkspaceSystemSettings object from a json dictionary."""
9797
9817
args = {}
9798
9818
valid_keys = [
9799
- 'tooling' , 'disambiguation' , 'human_agent_assist' , 'off_topic'
9819
+ 'tooling' , 'disambiguation' , 'human_agent_assist' ,
9820
+ 'system_entities' , 'off_topic'
9800
9821
]
9801
9822
bad_keys = set (_dict .keys ()) - set (valid_keys )
9802
9823
if bad_keys :
@@ -9812,6 +9833,10 @@ def from_dict(cls, _dict: Dict) -> 'WorkspaceSystemSettings':
9812
9833
_dict .get ('disambiguation' ))
9813
9834
if 'human_agent_assist' in _dict :
9814
9835
args ['human_agent_assist' ] = _dict .get ('human_agent_assist' )
9836
+ if 'system_entities' in _dict :
9837
+ args [
9838
+ 'system_entities' ] = WorkspaceSystemSettingsSystemEntities ._from_dict (
9839
+ _dict .get ('system_entities' ))
9815
9840
if 'off_topic' in _dict :
9816
9841
args ['off_topic' ] = WorkspaceSystemSettingsOffTopic ._from_dict (
9817
9842
_dict .get ('off_topic' ))
@@ -9833,6 +9858,9 @@ def to_dict(self) -> Dict:
9833
9858
self ,
9834
9859
'human_agent_assist' ) and self .human_agent_assist is not None :
9835
9860
_dict ['human_agent_assist' ] = self .human_agent_assist
9861
+ if hasattr (self ,
9862
+ 'system_entities' ) and self .system_entities is not None :
9863
+ _dict ['system_entities' ] = self .system_entities ._to_dict ()
9836
9864
if hasattr (self , 'off_topic' ) and self .off_topic is not None :
9837
9865
_dict ['off_topic' ] = self .off_topic ._to_dict ()
9838
9866
return _dict
0 commit comments