Skip to content

Commit 1df9e7f

Browse files
committed
doc(readme): Update readme with icp4d initialization
1 parent c979889 commit 1df9e7f

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Python client library to quickly get started with the various [Watson APIs][wdc]
2727
* [Disable SSL certificate verification](#disable-ssl-certificate-verification)
2828
* [Sending request headers](#sending-request-headers)
2929
* [Parsing HTTP response info](#parsing-http-response-info)
30+
* [Using Websockets](#using-websockets)
31+
* [IBM Cloud Pak for Data(ICP4D)](#ibm-cloud-pak-for-data(icp4d))
3032
* [Dependencies](#dependencies)
3133
* [License](#license)
3234
* [Contributing](#contributing)
@@ -322,6 +324,33 @@ service.synthesize_using_websocket('I like to pet dogs',
322324
)
323325
```
324326

327+
## IBM Cloud Pak for Data(ICP4D)
328+
If your service instance is of ICP4D, below are two ways of initializing the assistant service.
329+
330+
#### 1) Supplying the `username`, `password`, `icp4d_url` and `authentication_type`
331+
The SDK will manage the token for the user
332+
```python
333+
assistant = AssistantV1(
334+
version='<version',
335+
username='<your username>',
336+
password='<your password>',
337+
url='<service url>', # should be of the form https://{icp_cluster_host}/{deployment}/assistant/{instance-id}/api
338+
icp4d_url='<authentication url>', # should be of the form https://{icp_cluster_host}
339+
authentication_type='icp4d')
340+
341+
assistant.disable_SSL_verification() # MAKE SURE SSL VERIFICATION IS DISABLED
342+
```
343+
344+
#### 2) Supplying the access token
345+
```python
346+
assistant = AssistantV1(
347+
version='<version>',
348+
url='service url', # should be of the form https://{icp_cluster_host}/{deployment}/assistant/{instance-id}/api
349+
icp4d_access_token='<your managed access token>')
350+
351+
assistant.disable_SSL_verification() # MAKE SURE SSL VERIFICATION IS DISABLED
352+
```
353+
325354
## Dependencies
326355

327356
* [requests]

0 commit comments

Comments
 (0)