Skip to content

Commit 695abed

Browse files
authored
Merge pull request #740 from watson-developer-cloud/release-3-2020
Release 3 2020
2 parents 4e57026 + 46a812c commit 695abed

33 files changed

+2681
-3190
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,6 @@ test/__init__.py
6969
# ignore detect secrets files
7070
.pre-commit-config.yaml
7171
.secrets.baseline
72+
73+
.openapi-generator-ignore
74+
.openapi-generator/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ IBM Cloud has migrated to token-based Identity and Access Management (IAM) authe
164164
You supply either an IAM service **API key** or a **bearer token**:
165165

166166
- Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
167-
- Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/services/watson?topic=watson-iam).
167+
- Use the access token if you want to manage the lifecycle yourself. For details, see [Authenticating with IAM tokens](https://cloud.ibm.com/docs/watson?topic=watson-iam).
168168
- Use a server-side to generate access tokens using your IAM API key for untrusted environments like client-side scripts. The generated access tokens will be valid for one hour and can be refreshed.
169169

170170
#### Supplying the API key
@@ -513,5 +513,5 @@ This library is licensed under the [Apache 2.0 license][license].
513513
[examples]: https://github.com/watson-developer-cloud/python-sdk/tree/master/examples
514514
[CONTRIBUTING]: https://github.com/watson-developer-cloud/python-sdk/blob/master/CONTRIBUTING.md
515515
[license]: http://www.apache.org/licenses/LICENSE-2.0
516-
[vcap_services]: https://cloud.ibm.com/docs/services/watson?topic=watson-vcapServices
516+
[vcap_services]: https://cloud.ibm.com/docs/watson?topic=watson-vcapServices
517517
[ibm-cloud-onboarding]: https://cloud.ibm.com/registration?target=/developer/watson&cm_sp=WatsonPlatform-WatsonServices-_-OnPageNavLink-IBMWatson_SDKs-_-Python

examples/assistant_tone_analyzer_integration/tone_detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Thresholds for identifying meaningful tones returned by the Watson Tone
1616
Analyzer. Current values are
1717
* based on the recommendations made by the Watson Tone Analyzer at
18-
* https://cloud.ibm.com/docs/services/tone-analyzer?topic=tone-analyzer-utgpe
18+
* https://cloud.ibm.com/docs/tone-analyzer?topic=tone-analyzer-utgpe
1919
* These thresholds can be adjusted to client/domain requirements.
2020
"""
2121

ibm_watson/assistant_v1.py

Lines changed: 115 additions & 20 deletions
Large diffs are not rendered by default.

ibm_watson/assistant_v2.py

Lines changed: 44 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,17 +1219,19 @@ class MessageContextSkill():
12191219
12201220
:attr dict user_defined: (optional) Arbitrary variables that can be read and
12211221
written by a particular skill.
1222-
:attr dict system: (optional) For internal use only.
1222+
:attr dict system: (optional) System context data used by the skill.
12231223
"""
12241224

1225-
def __init__(self, *, user_defined: dict = None,
1225+
def __init__(self,
1226+
*,
1227+
user_defined: dict = None,
12261228
system: dict = None) -> None:
12271229
"""
12281230
Initialize a MessageContextSkill object.
12291231
12301232
:param dict user_defined: (optional) Arbitrary variables that can be read
12311233
and written by a particular skill.
1232-
:param dict system: (optional) For internal use only.
1234+
:param dict system: (optional) System context data used by the skill.
12331235
"""
12341236
self.user_defined = user_defined
12351237
self.system = system
@@ -1488,49 +1490,68 @@ class MessageInputOptions():
14881490
Optional properties that control how the assistant responds.
14891491
14901492
:attr bool debug: (optional) Whether to return additional diagnostic
1491-
information. Set to `true` to return additional information under the
1492-
`output.debug` key.
1493+
information. Set to `true` to return additional information in the
1494+
`output.debug` property. If you also specify **return_context**=`true`, the
1495+
returned skill context includes the `system.state` property.
14931496
:attr bool restart: (optional) Whether to restart dialog processing at the root
14941497
of the dialog, regardless of any previously visited nodes. **Note:** This does
14951498
not affect `turn_count` or any other context variables.
14961499
:attr bool alternate_intents: (optional) Whether to return more than one intent.
14971500
Set to `true` to return all matching intents.
14981501
:attr bool return_context: (optional) Whether to return session context with the
1499-
response. If you specify `true`, the response will include the `context`
1500-
property.
1502+
response. If you specify `true`, the response includes the `context` property.
1503+
If you also specify **debug**=`true`, the returned skill context includes the
1504+
`system.state` property.
1505+
:attr bool export: (optional) Whether to return session context, including full
1506+
conversation state. If you specify `true`, the response includes the `context`
1507+
property, and the skill context includes the `system.state` property.
1508+
**Note:** If **export**=`true`, the context is returned regardless of the value
1509+
of **return_context**.
15011510
"""
15021511

15031512
def __init__(self,
15041513
*,
15051514
debug: bool = None,
15061515
restart: bool = None,
15071516
alternate_intents: bool = None,
1508-
return_context: bool = None) -> None:
1517+
return_context: bool = None,
1518+
export: bool = None) -> None:
15091519
"""
15101520
Initialize a MessageInputOptions object.
15111521
15121522
:param bool debug: (optional) Whether to return additional diagnostic
1513-
information. Set to `true` to return additional information under the
1514-
`output.debug` key.
1523+
information. Set to `true` to return additional information in the
1524+
`output.debug` property. If you also specify **return_context**=`true`, the
1525+
returned skill context includes the `system.state` property.
15151526
:param bool restart: (optional) Whether to restart dialog processing at the
15161527
root of the dialog, regardless of any previously visited nodes. **Note:**
15171528
This does not affect `turn_count` or any other context variables.
15181529
:param bool alternate_intents: (optional) Whether to return more than one
15191530
intent. Set to `true` to return all matching intents.
15201531
:param bool return_context: (optional) Whether to return session context
1521-
with the response. If you specify `true`, the response will include the
1522-
`context` property.
1532+
with the response. If you specify `true`, the response includes the
1533+
`context` property. If you also specify **debug**=`true`, the returned
1534+
skill context includes the `system.state` property.
1535+
:param bool export: (optional) Whether to return session context, including
1536+
full conversation state. If you specify `true`, the response includes the
1537+
`context` property, and the skill context includes the `system.state`
1538+
property.
1539+
**Note:** If **export**=`true`, the context is returned regardless of the
1540+
value of **return_context**.
15231541
"""
15241542
self.debug = debug
15251543
self.restart = restart
15261544
self.alternate_intents = alternate_intents
15271545
self.return_context = return_context
1546+
self.export = export
15281547

15291548
@classmethod
15301549
def from_dict(cls, _dict: Dict) -> 'MessageInputOptions':
15311550
"""Initialize a MessageInputOptions object from a json dictionary."""
15321551
args = {}
1533-
valid_keys = ['debug', 'restart', 'alternate_intents', 'return_context']
1552+
valid_keys = [
1553+
'debug', 'restart', 'alternate_intents', 'return_context', 'export'
1554+
]
15341555
bad_keys = set(_dict.keys()) - set(valid_keys)
15351556
if bad_keys:
15361557
raise ValueError(
@@ -1544,6 +1565,8 @@ def from_dict(cls, _dict: Dict) -> 'MessageInputOptions':
15441565
args['alternate_intents'] = _dict.get('alternate_intents')
15451566
if 'return_context' in _dict:
15461567
args['return_context'] = _dict.get('return_context')
1568+
if 'export' in _dict:
1569+
args['export'] = _dict.get('export')
15471570
return cls(**args)
15481571

15491572
@classmethod
@@ -1563,6 +1586,8 @@ def to_dict(self) -> Dict:
15631586
_dict['alternate_intents'] = self.alternate_intents
15641587
if hasattr(self, 'return_context') and self.return_context is not None:
15651588
_dict['return_context'] = self.return_context
1589+
if hasattr(self, 'export') and self.export is not None:
1590+
_dict['export'] = self.export
15661591
return _dict
15671592

15681593
def _to_dict(self):
@@ -1836,8 +1861,8 @@ class MessageResponse():
18361861
18371862
:attr MessageOutput output: Assistant output to be rendered or processed by the
18381863
client.
1839-
:attr MessageContext context: (optional) State information for the conversation.
1840-
The context is stored by the assistant on a per-session basis. You can use this
1864+
:attr MessageContext context: (optional) Context data for the conversation. The
1865+
context is stored by the assistant on a per-session basis. You can use this
18411866
property to access context variables.
18421867
**Note:** The context is included in message responses only if
18431868
**return_context**=`true` in the message request.
@@ -1852,7 +1877,7 @@ def __init__(self,
18521877
18531878
:param MessageOutput output: Assistant output to be rendered or processed
18541879
by the client.
1855-
:param MessageContext context: (optional) State information for the
1880+
:param MessageContext context: (optional) Context data for the
18561881
conversation. The context is stored by the assistant on a per-session
18571882
basis. You can use this property to access context variables.
18581883
**Note:** The context is included in message responses only if
@@ -3191,7 +3216,9 @@ class SearchResultMetadata():
31913216
indicates a greater match to the query parameters.
31923217
"""
31933218

3194-
def __init__(self, *, confidence: float = None,
3219+
def __init__(self,
3220+
*,
3221+
confidence: float = None,
31953222
score: float = None) -> None:
31963223
"""
31973224
Initialize a SearchResultMetadata object.

ibm_watson/compare_comply_v1.py

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,10 @@ def list_feedback(self,
487487
response = self.send(request)
488488
return response
489489

490-
def get_feedback(self, feedback_id: str, *, model: str = None,
490+
def get_feedback(self,
491+
feedback_id: str,
492+
*,
493+
model: str = None,
491494
**kwargs) -> 'DetailedResponse':
492495
"""
493496
Get a specified feedback entry.
@@ -528,7 +531,10 @@ def get_feedback(self, feedback_id: str, *, model: str = None,
528531
response = self.send(request)
529532
return response
530533

531-
def delete_feedback(self, feedback_id: str, *, model: str = None,
534+
def delete_feedback(self,
535+
feedback_id: str,
536+
*,
537+
model: str = None,
532538
**kwargs) -> 'DetailedResponse':
533539
"""
534540
Delete a specified feedback entry.
@@ -589,10 +595,10 @@ def create_batch(self,
589595
590596
Run Compare and Comply methods over a collection of input documents.
591597
**Important:** Batch processing requires the use of the [IBM Cloud Object Storage
592-
service](https://cloud.ibm.com/docs/services/cloud-object-storage?topic=cloud-object-storage-about#about-ibm-cloud-object-storage).
598+
service](https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-about#about-ibm-cloud-object-storage).
593599
The use of IBM Cloud Object Storage with Compare and Comply is discussed at [Using
594600
batch
595-
processing](https://cloud.ibm.com/docs/services/compare-comply?topic=compare-comply-batching#before-you-batch).
601+
processing](https://cloud.ibm.com/docs/compare-comply?topic=compare-comply-batching#before-you-batch).
596602
597603
:param str function: The Compare and Comply method to run across the
598604
submitted input documents.
@@ -996,7 +1002,9 @@ class Address():
9961002
`end`.
9971003
"""
9981004

999-
def __init__(self, *, text: str = None,
1005+
def __init__(self,
1006+
*,
1007+
text: str = None,
10001008
location: 'Location' = None) -> None:
10011009
"""
10021010
Initialize a Address object.
@@ -1725,7 +1733,9 @@ class Category():
17251733
IBM to provide feedback or receive support.
17261734
"""
17271735

1728-
def __init__(self, *, label: str = None,
1736+
def __init__(self,
1737+
*,
1738+
label: str = None,
17291739
provenance_ids: List[str] = None) -> None:
17301740
"""
17311741
Initialize a Category object.
@@ -2502,7 +2512,9 @@ class Contexts():
25022512
`end`.
25032513
"""
25042514

2505-
def __init__(self, *, text: str = None,
2515+
def __init__(self,
2516+
*,
2517+
text: str = None,
25062518
location: 'Location' = None) -> None:
25072519
"""
25082520
Initialize a Contexts object.
@@ -3150,7 +3162,10 @@ class DocInfo():
31503162
:attr str hash: (optional) The MD5 hash of the input document.
31513163
"""
31523164

3153-
def __init__(self, *, html: str = None, title: str = None,
3165+
def __init__(self,
3166+
*,
3167+
html: str = None,
3168+
title: str = None,
31543169
hash: str = None) -> None:
31553170
"""
31563171
Initialize a DocInfo object.
@@ -4761,7 +4776,9 @@ class KeyValuePair():
47614776
:attr List[Value] value: (optional) A list of values in a key-value pair.
47624777
"""
47634778

4764-
def __init__(self, *, key: 'Key' = None,
4779+
def __init__(self,
4780+
*,
4781+
key: 'Key' = None,
47654782
value: List['Value'] = None) -> None:
47664783
"""
47674784
Initialize a KeyValuePair object.
@@ -5070,7 +5087,9 @@ class Mention():
50705087
`end`.
50715088
"""
50725089

5073-
def __init__(self, *, text: str = None,
5090+
def __init__(self,
5091+
*,
5092+
text: str = None,
50745093
location: 'Location' = None) -> None:
50755094
"""
50765095
Initialize a Mention object.
@@ -5896,7 +5915,9 @@ class SectionTitle():
58965915
`end`.
58975916
"""
58985917

5899-
def __init__(self, *, text: str = None,
5918+
def __init__(self,
5919+
*,
5920+
text: str = None,
59005921
location: 'Location' = None) -> None:
59015922
"""
59025923
Initialize a SectionTitle object.
@@ -6369,7 +6390,9 @@ class TableTitle():
63696390
:attr str text: (optional) The text of the identified table title or caption.
63706391
"""
63716392

6372-
def __init__(self, *, location: 'Location' = None,
6393+
def __init__(self,
6394+
*,
6395+
location: 'Location' = None,
63736396
text: str = None) -> None:
63746397
"""
63756398
Initialize a TableTitle object.

0 commit comments

Comments
 (0)