You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,7 +41,7 @@ Python client library to quickly get started with the various [Watson APIs][wdc]
41
41
</details>
42
42
43
43
## Before you begin
44
-
* You need an [IBM Cloud][ibm-cloud-onboarding] account.
44
+
* You need an [IBM Cloud][ibm-cloud-onboarding] account. We now only support `python 3.5` and above
45
45
46
46
## Installation
47
47
To install, use `pip` or `easy_install`:
@@ -94,8 +94,6 @@ Watson services are migrating to token-based Identity and Access Management (IAM
94
94
- With some service instances, you authenticate to the API by using **[IAM](#iam)**.
95
95
- In other instances, you authenticate by providing the **[username and password](#username-and-password)** for the service instance.
96
96
97
-
**Note:** Authenticating with the X-Watson-Authorization-Token header is deprecated. The token continues to work with Cloud Foundry services, but is not supported for services that use Identity and Access Management (IAM) authentication. See [here](#iam) for details.
98
-
99
97
### Getting credentials
100
98
To find out which authentication to use, view the service credentials. You find the service credentials for authentication the same way for all Watson services:
101
99
@@ -115,8 +113,8 @@ With a credential file, you just need to put the file in the right place and the
115
113
116
114
The file downloaded will be called `ibm-credentials.env`. This is the name the SDK will search for and **must** be preserved unless you want to configure the file path (more on that later). The SDK will look for your `ibm-credentials.env` file in the following places (in order):
117
115
118
-
- Your system's home directory
119
116
- The top-level directory of the project you're using the SDK in
117
+
- Your system's home directory
120
118
121
119
As long as you set that up correctly, you don't have to worry about setting any authentication options in your code. So, for example, if you created and downloaded the credential file for your Discovery instance, you just need to do the following:
122
120
@@ -140,8 +138,8 @@ where `<path>` is something like `/home/user/Downloads/<file_name>.env`.
140
138
Simply set the environment variables using <servicename>_<variablename> syntax. For example, using your favourite terminal, you can set environment variables for Assistant service instance:
141
139
142
140
```bash
143
-
exportassistant_apikey="<your apikey>"
144
-
exportassistant_auth_type="iam"
141
+
exportASSISTANT_APIKEY="<your apikey>"
142
+
exportASSISTANT_AUTH_TYPE="iam"
145
143
```
146
144
147
145
The credentials will be loaded from the environment automatically
For more information, follow the [MIGRATION-V4](https://github.com/watson-developer-cloud/python-sdk/MIGRATION-V4.md)
264
263
265
264
## Migration
266
-
This version includes many breaking changes as a result of standardizing behavior across the new generated services. Full details on migration from previous versions can be found [here](https://github.com/watson-developer-cloud/python-sdk/wiki/Migration).
265
+
To move from v3.x to v4.0, refer to the [MIGRATION-V4](https://github.com/watson-developer-cloud/python-sdk/MIGRATION-V4.md).
267
266
268
267
## Configuring the http client (Supported from v1.1.0)
269
-
To set client configs like timeout use the `with_http_config()` function and pass it a dictionary of configs.
268
+
To set client configs like timeout use the `with_http_config()` function and pass it a dictionary of configs. For example for a Assistant service instance
270
269
271
270
```python
272
271
from ibm_watson import AssistantV1
@@ -291,14 +290,20 @@ For ICP(IBM Cloud Private), you can disable the SSL certificate verification by:
291
290
service.set_disable_ssl_verification(True)
292
291
```
293
292
293
+
Or can set it from extrernal sources. For example set in the environment variable.
294
+
295
+
```
296
+
export <service name>_DISABLE_SSL=True
297
+
```
298
+
294
299
## Setting the service url
295
300
To set the base service to be used when contacting the service
296
301
297
302
```python
298
303
service.set_service_url('my_new_service_url')
299
304
```
300
305
301
-
Or can set it in the environment variable.
306
+
Or can set it from extrernal sources. For example set in the environment variable.
If you would like access to some HTTP response information along with the response model, you can set the `set_detailed_response()` to `True`. Since Python SDK `v2.0`, it is set to `True`
0 commit comments