diff --git a/_version.py b/_version.py index 1943bb0..2a98645 100644 --- a/_version.py +++ b/_version.py @@ -1,4 +1,4 @@ # Semantic versioning # MAJOR.MINOR.PATCH -__version__ = '1.0.0' +__version__ = '1.0.1' diff --git a/assistant_dialog_skill_analysis/__init__.py b/assistant_dialog_skill_analysis/__init__.py index 1f356cc..cd7ca49 100644 --- a/assistant_dialog_skill_analysis/__init__.py +++ b/assistant_dialog_skill_analysis/__init__.py @@ -1 +1 @@ -__version__ = '1.0.0' +__version__ = '1.0.1' diff --git a/assistant_dialog_skill_analysis/utils/skills_util.py b/assistant_dialog_skill_analysis/utils/skills_util.py index 462ead1..b696eff 100644 --- a/assistant_dialog_skill_analysis/utils/skills_util.py +++ b/assistant_dialog_skill_analysis/utils/skills_util.py @@ -10,6 +10,8 @@ from nbconvert.preprocessors import ExecutePreprocessor import nltk import ibm_watson +from ibm_cloud_sdk_core.authenticators import \ + IAMAuthenticator, BasicAuthenticator, NoAuthAuthenticator DEFAULT_API_VERSION = '2019-02-28' DEFAULT_PROD_URL = 'https://gateway.watsonplatform.net/assistant/api' @@ -113,30 +115,15 @@ def retrieve_workspace(iam_apikey=None, :param export_flag: :return workspace: workspace json """ - conversation = None if iam_apikey: - if url == "https://gateway-s.watsonplatform.net/assistant/api": - conversation = ibm_watson.AssistantV1(iam_apikey=iam_apikey, - url=url, - iam_url=STAGE_IAM_URL, - version=api_version) - else: - conversation = ibm_watson.AssistantV1(iam_apikey=iam_apikey, - url=url, - version=api_version) + authenticator = IAMAuthenticator(apikey=iam_apikey) elif username and password: - if url == "https://gateway-s.watsonplatform.net/assistant/api": - conversation = ibm_watson.AssistantV1(username=username, - password=password, - url=url, - iam_url=STAGE_IAM_URL, - version=api_version) - else: - conversation = ibm_watson.AssistantV1(username=username, - password=password, - url=url, - version=api_version) + authenticator = BasicAuthenticator(username=username, password=password) + else: + authenticator = NoAuthAuthenticator() + + conversation = ibm_watson.AssistantV1(authenticator=authenticator, version=api_version) if export_flag: ws_json = conversation.get_workspace(workspace_id, export=export_flag) diff --git a/requirements.txt b/requirements.txt index d8d2fba..41a315c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,6 @@ tabulate matplotlib nltk seaborn -ibm-watson>=3.2.0 +ibm-watson==4.0.1 scipy>=1.2.0 jupyter