Skip to content

Commit 996ff85

Browse files
authored
Merge pull request #747 from watson-developer-cloud/feat/release-4-2020
Feat/release 4 2020
2 parents fa0f80a + 421482d commit 996ff85

12 files changed

+1312
-127
lines changed

.env.enc

0 Bytes
Binary file not shown.

ibm_watson/assistant_v1.py

Lines changed: 104 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7275,17 +7275,61 @@ class MessageInput():
72757275
72767276
:attr str text: (optional) The text of the user input. This string cannot
72777277
contain carriage return, newline, or tab characters.
7278+
:attr bool spelling_suggestions: (optional) Whether to use spelling correction
7279+
when processing the input. This property overrides the value of the
7280+
**spelling_suggestions** property in the workspace settings.
7281+
:attr bool spelling_auto_correct: (optional) Whether to use autocorrection when
7282+
processing the input. If spelling correction is used and this property is
7283+
`false`, any suggested corrections are returned in the **suggested_text**
7284+
property of the message response. If this property is `true`, any corrections
7285+
are automatically applied to the user input, and the original text is returned
7286+
in the **original_text** property of the message response. This property
7287+
overrides the value of the **spelling_auto_correct** property in the workspace
7288+
settings.
7289+
:attr str suggested_text: (optional) Any suggested corrections of the input
7290+
text. This property is returned only if spelling correction is enabled and
7291+
autocorrection is disabled.
7292+
:attr str original_text: (optional) The original user input text. This property
7293+
is returned only if autocorrection is enabled and the user input was corrected.
72787294
"""
72797295

7280-
def __init__(self, *, text: str = None, **kwargs) -> None:
7296+
def __init__(self,
7297+
*,
7298+
text: str = None,
7299+
spelling_suggestions: bool = None,
7300+
spelling_auto_correct: bool = None,
7301+
suggested_text: str = None,
7302+
original_text: str = None,
7303+
**kwargs) -> None:
72817304
"""
72827305
Initialize a MessageInput object.
72837306
72847307
:param str text: (optional) The text of the user input. This string cannot
72857308
contain carriage return, newline, or tab characters.
7309+
:param bool spelling_suggestions: (optional) Whether to use spelling
7310+
correction when processing the input. This property overrides the value of
7311+
the **spelling_suggestions** property in the workspace settings.
7312+
:param bool spelling_auto_correct: (optional) Whether to use autocorrection
7313+
when processing the input. If spelling correction is used and this property
7314+
is `false`, any suggested corrections are returned in the
7315+
**suggested_text** property of the message response. If this property is
7316+
`true`, any corrections are automatically applied to the user input, and
7317+
the original text is returned in the **original_text** property of the
7318+
message response. This property overrides the value of the
7319+
**spelling_auto_correct** property in the workspace settings.
7320+
:param str suggested_text: (optional) Any suggested corrections of the
7321+
input text. This property is returned only if spelling correction is
7322+
enabled and autocorrection is disabled.
7323+
:param str original_text: (optional) The original user input text. This
7324+
property is returned only if autocorrection is enabled and the user input
7325+
was corrected.
72867326
:param **kwargs: (optional) Any additional properties.
72877327
"""
72887328
self.text = text
7329+
self.spelling_suggestions = spelling_suggestions
7330+
self.spelling_auto_correct = spelling_auto_correct
7331+
self.suggested_text = suggested_text
7332+
self.original_text = original_text
72897333
for _key, _value in kwargs.items():
72907334
setattr(self, _key, _value)
72917335

@@ -7297,6 +7341,18 @@ def from_dict(cls, _dict: Dict) -> 'MessageInput':
72977341
if 'text' in _dict:
72987342
args['text'] = _dict.get('text')
72997343
del xtra['text']
7344+
if 'spelling_suggestions' in _dict:
7345+
args['spelling_suggestions'] = _dict.get('spelling_suggestions')
7346+
del xtra['spelling_suggestions']
7347+
if 'spelling_auto_correct' in _dict:
7348+
args['spelling_auto_correct'] = _dict.get('spelling_auto_correct')
7349+
del xtra['spelling_auto_correct']
7350+
if 'suggested_text' in _dict:
7351+
args['suggested_text'] = _dict.get('suggested_text')
7352+
del xtra['suggested_text']
7353+
if 'original_text' in _dict:
7354+
args['original_text'] = _dict.get('original_text')
7355+
del xtra['original_text']
73007356
args.update(xtra)
73017357
return cls(**args)
73027358

@@ -7310,6 +7366,16 @@ def to_dict(self) -> Dict:
73107366
_dict = {}
73117367
if hasattr(self, 'text') and self.text is not None:
73127368
_dict['text'] = self.text
7369+
if hasattr(self, 'spelling_suggestions'
7370+
) and self.spelling_suggestions is not None:
7371+
_dict['spelling_suggestions'] = self.spelling_suggestions
7372+
if hasattr(self, 'spelling_auto_correct'
7373+
) and self.spelling_auto_correct is not None:
7374+
_dict['spelling_auto_correct'] = self.spelling_auto_correct
7375+
if hasattr(self, 'suggested_text') and self.suggested_text is not None:
7376+
_dict['suggested_text'] = self.suggested_text
7377+
if hasattr(self, 'original_text') and self.original_text is not None:
7378+
_dict['original_text'] = self.original_text
73137379
if hasattr(self, '_additionalProperties'):
73147380
for _key in self._additionalProperties:
73157381
_value = getattr(self, _key, None)
@@ -7322,7 +7388,10 @@ def _to_dict(self):
73227388
return self.to_dict()
73237389

73247390
def __setattr__(self, name: str, value: object) -> None:
7325-
properties = {'text'}
7391+
properties = {
7392+
'text', 'spelling_suggestions', 'spelling_auto_correct',
7393+
'suggested_text', 'original_text'
7394+
}
73267395
if not hasattr(self, '_additionalProperties'):
73277396
super(MessageInput, self).__setattr__('_additionalProperties',
73287397
set())
@@ -9872,6 +9941,14 @@ class WorkspaceSystemSettings():
98729941
settings related to the disambiguation feature.
98739942
**Note:** This feature is available only to Plus and Premium users.
98749943
:attr dict human_agent_assist: (optional) For internal use only.
9944+
:attr bool spelling_suggestions: (optional) Whether spelling correction is
9945+
enabled for the workspace.
9946+
:attr bool spelling_auto_correct: (optional) Whether autocorrection is enabled
9947+
for the workspace. If spelling correction is enabled and this property is
9948+
`false`, any suggested corrections are returned in the **suggested_text**
9949+
property of the message response. If this property is `true`, any corrections
9950+
are automatically applied to the user input, and the original text is returned
9951+
in the **original_text** property of the message response.
98759952
:attr WorkspaceSystemSettingsSystemEntities system_entities: (optional)
98769953
Workspace settings related to the behavior of system entities.
98779954
:attr WorkspaceSystemSettingsOffTopic off_topic: (optional) Workspace settings
@@ -9884,6 +9961,8 @@ def __init__(
98849961
tooling: 'WorkspaceSystemSettingsTooling' = None,
98859962
disambiguation: 'WorkspaceSystemSettingsDisambiguation' = None,
98869963
human_agent_assist: dict = None,
9964+
spelling_suggestions: bool = None,
9965+
spelling_auto_correct: bool = None,
98879966
system_entities: 'WorkspaceSystemSettingsSystemEntities' = None,
98889967
off_topic: 'WorkspaceSystemSettingsOffTopic' = None) -> None:
98899968
"""
@@ -9895,6 +9974,15 @@ def __init__(
98959974
Workspace settings related to the disambiguation feature.
98969975
**Note:** This feature is available only to Plus and Premium users.
98979976
:param dict human_agent_assist: (optional) For internal use only.
9977+
:param bool spelling_suggestions: (optional) Whether spelling correction is
9978+
enabled for the workspace.
9979+
:param bool spelling_auto_correct: (optional) Whether autocorrection is
9980+
enabled for the workspace. If spelling correction is enabled and this
9981+
property is `false`, any suggested corrections are returned in the
9982+
**suggested_text** property of the message response. If this property is
9983+
`true`, any corrections are automatically applied to the user input, and
9984+
the original text is returned in the **original_text** property of the
9985+
message response.
98989986
:param WorkspaceSystemSettingsSystemEntities system_entities: (optional)
98999987
Workspace settings related to the behavior of system entities.
99009988
:param WorkspaceSystemSettingsOffTopic off_topic: (optional) Workspace
@@ -9903,6 +9991,8 @@ def __init__(
99039991
self.tooling = tooling
99049992
self.disambiguation = disambiguation
99059993
self.human_agent_assist = human_agent_assist
9994+
self.spelling_suggestions = spelling_suggestions
9995+
self.spelling_auto_correct = spelling_auto_correct
99069996
self.system_entities = system_entities
99079997
self.off_topic = off_topic
99089998

@@ -9912,7 +10002,8 @@ def from_dict(cls, _dict: Dict) -> 'WorkspaceSystemSettings':
991210002
args = {}
991310003
valid_keys = [
991410004
'tooling', 'disambiguation', 'human_agent_assist',
9915-
'system_entities', 'off_topic'
10005+
'spelling_suggestions', 'spelling_auto_correct', 'system_entities',
10006+
'off_topic'
991610007
]
991710008
bad_keys = set(_dict.keys()) - set(valid_keys)
991810009
if bad_keys:
@@ -9928,6 +10019,10 @@ def from_dict(cls, _dict: Dict) -> 'WorkspaceSystemSettings':
992810019
_dict.get('disambiguation'))
992910020
if 'human_agent_assist' in _dict:
993010021
args['human_agent_assist'] = _dict.get('human_agent_assist')
10022+
if 'spelling_suggestions' in _dict:
10023+
args['spelling_suggestions'] = _dict.get('spelling_suggestions')
10024+
if 'spelling_auto_correct' in _dict:
10025+
args['spelling_auto_correct'] = _dict.get('spelling_auto_correct')
993110026
if 'system_entities' in _dict:
993210027
args[
993310028
'system_entities'] = WorkspaceSystemSettingsSystemEntities._from_dict(
@@ -9953,6 +10048,12 @@ def to_dict(self) -> Dict:
995310048
self,
995410049
'human_agent_assist') and self.human_agent_assist is not None:
995510050
_dict['human_agent_assist'] = self.human_agent_assist
10051+
if hasattr(self, 'spelling_suggestions'
10052+
) and self.spelling_suggestions is not None:
10053+
_dict['spelling_suggestions'] = self.spelling_suggestions
10054+
if hasattr(self, 'spelling_auto_correct'
10055+
) and self.spelling_auto_correct is not None:
10056+
_dict['spelling_auto_correct'] = self.spelling_auto_correct
995610057
if hasattr(self,
995710058
'system_entities') and self.system_entities is not None:
995810059
_dict['system_entities'] = self.system_entities._to_dict()

0 commit comments

Comments
 (0)