From 2ad6745764b1f3b64d8cd5ea6880831661c8a2b1 Mon Sep 17 00:00:00 2001 From: mparnisari Date: Sun, 3 Dec 2017 18:39:36 -0800 Subject: [PATCH 1/5] Add "region" parameter to clients. --- python2/luis_sdk/luis_client.py | 18 +++++++++++++----- python2/sample_app.py | 3 ++- python2/sample_app_async.py | 3 ++- python3/luis_sdk/luis_client.py | 18 +++++++++++++----- python3/sample_app.py | 3 ++- python3/sample_app_async.py | 3 ++- 6 files changed, 34 insertions(+), 14 deletions(-) diff --git a/python2/luis_sdk/luis_client.py b/python2/luis_sdk/luis_client.py index 811a305..74acdc9 100644 --- a/python2/luis_sdk/luis_client.py +++ b/python2/luis_sdk/luis_client.py @@ -39,18 +39,19 @@ class LUISClient(object): ''' This is the interface of the LUIS - Constructs a LUISClient with the corresponding user's App Id and Subscription Keys + Constructs a LUISClient with the corresponding user's App Id, region Subscription Keys Starts the prediction procedure for the user's text, and accepts a callback function ''' - _LUISURL = u'westus.api.cognitive.microsoft.com' + _LUISURLMASK = u'%s.api.cognitive.microsoft.com' _PredictMask = u'/luis/v2.0/apps/%s?subscription-key=%s&q=%s&verbose=%s' _ReplyMask = u'/luis/v2.0/apps/%s?subscription-key=%s&q=%s&contextid=%s&verbose=%s' - def __init__(self, app_id, app_key, verbose=True): + def __init__(self, app_id, app_key, region, verbose=True): ''' A constructor for the LUISClient class. :param app_id: A string containing the application id. :param app_key: A string containing the subscription key. + :param region: A string containing the region of the subscription. :param verbose: A boolean to indicate whether the verbose version should used or not. ''' if app_id is None: @@ -65,9 +66,16 @@ def __init__(self, app_id, app_key, verbose=True): raise ValueError(u'Empty Subscription Key') if u' ' in app_key: raise ValueError(u'Invalid Subscription Key') + if region is None: + raise TypeError(u'NULL Region') + if not region: + raise ValueError(u'Empty Region') + if ' ' in region: + raise ValueError(u'Invalid Region') self._app_id = app_id self._app_key = app_key + self._region = region self._verbose = u'true' if verbose else u'false' def predict(self, text, response_handlers=None, daemon=False): @@ -97,7 +105,7 @@ def predict_sync(self, text): :return: A LUISResponse object containing the response data. ''' try: - conn = httplib.HTTPSConnection(self._LUISURL) + conn = httplib.HTTPSConnection(self._LUISURLMASK % self._region) conn.request(u'GET', self._predict_url_gen(text)) res = conn.getresponse() return LUISResponse(res.read().decode(u'UTF-8')) @@ -181,7 +189,7 @@ def reply_sync(self, text, response, force_set_parameter_name=None): :return: A LUISResponse object containg the response data. ''' try: - conn = httplib.HTTPSConnection(self._LUISURL) + conn = httplib.HTTPSConnection(self._LUISURLMASK % self._region) conn.request(u'GET', self._reply_url_gen(text, response, force_set_parameter_name)) res = conn.getresponse() return LUISResponse(res.read().decode(u'UTF-8')) diff --git a/python2/sample_app.py b/python2/sample_app.py index 0c214fd..8febd9d 100644 --- a/python2/sample_app.py +++ b/python2/sample_app.py @@ -61,8 +61,9 @@ def process_res(res): try: APPID = raw_input(u'Please enter your app Id:\n') APPKEY = raw_input(u'Please input your subscription key:\n') + REGION = raw_input(u'Please input your region:\n') TEXT = raw_input(u'Please input the text to predict:\n') - CLIENT = LUISClient(APPID, APPKEY, True) + CLIENT = LUISClient(APPID, APPKEY, REGION, True) res = CLIENT.predict(TEXT) while res.get_dialog() is not None and not res.get_dialog().is_finished(): TEXT = raw_input(u'%s\n'%res.get_dialog().get_prompt()) diff --git a/python2/sample_app_async.py b/python2/sample_app_async.py index af0cbdd..4a0c6f1 100644 --- a/python2/sample_app_async.py +++ b/python2/sample_app_async.py @@ -71,8 +71,9 @@ def on_failure(err): try: APPID = raw_input(u'Please enter your app Id:\n') APPKEY = raw_input(u'Please input your subscription key:\n') + REGION = raw_input(u'Please input your region:\n') TEXT = raw_input(u'Please input the text to predict:\n') - CLIENT = LUISClient(APPID, APPKEY, True) + CLIENT = LUISClient(APPID, APPKEY, REGION, True) CLIENT.predict(TEXT, {u'on_success': on_success, u'on_failure': on_failure}) print u'-------\nMain thread finishing!!\n-------' except Exception, exc: diff --git a/python3/luis_sdk/luis_client.py b/python3/luis_sdk/luis_client.py index cd9e179..33b8b0c 100644 --- a/python3/luis_sdk/luis_client.py +++ b/python3/luis_sdk/luis_client.py @@ -39,18 +39,19 @@ class LUISClient: ''' This is the interface of the LUIS - Constructs a LUISClient with the corresponding user's App Id and Subscription Keys + Constructs a LUISClient with the corresponding user's App Id, region and Subscription Keys Starts the prediction procedure for the user's text, and accepts a callback function ''' - _LUISURL = 'westus.api.cognitive.microsoft.com' + _LUISURLMASK = '%s.api.cognitive.microsoft.com' _PredictMask = '/luis/v2.0/apps/%s?subscription-key=%s&q=%s&verbose=%s' _ReplyMask = '/luis/v2.0/apps/%s?subscription-key=%s&q=%s&contextid=%s&verbose=%s' - def __init__(self, app_id, app_key, verbose=True): + def __init__(self, app_id, app_key, region, verbose=True): ''' A constructor for the LUISClient class. :param app_id: A string containing the application id. :param app_key: A string containing the subscription key. + :param region: A string containing the region of the subscription. :param verbose: A boolean to indicate whether the verbose version should used or not. ''' if app_id is None: @@ -65,9 +66,16 @@ def __init__(self, app_id, app_key, verbose=True): raise ValueError('Empty Subscription Key') if ' ' in app_key: raise ValueError('Invalid Subscription Key') + if region is None: + raise TypeError('NULL Region') + if not region: + raise ValueError('Empty Region') + if ' ' in region: + raise ValueError('Invalid Region') self._app_id = app_id self._app_key = app_key + self._region = region self._verbose = 'true' if verbose else 'false' def predict(self, text, response_handlers=None, daemon=False): @@ -97,7 +105,7 @@ def predict_sync(self, text): :return: A LUISResponse object containing the response data. ''' try: - conn = http.client.HTTPSConnection(self._LUISURL) + conn = http.client.HTTPSConnection(self._LUISURLMASK % self._region) conn.request('GET', self._predict_url_gen(text)) res = conn.getresponse() return LUISResponse(res.read().decode('UTF-8')) @@ -181,7 +189,7 @@ def reply_sync(self, text, response, force_set_parameter_name): :return: A LUISResponse object containg the response data. ''' try: - conn = http.client.HTTPSConnection(self._LUISURL) + conn = http.client.HTTPSConnection(self._LUISURLMASK % self._region) conn.request('GET', self._reply_url_gen(text, response, force_set_parameter_name)) res = conn.getresponse() return LUISResponse(res.read().decode('UTF-8')) diff --git a/python3/sample_app.py b/python3/sample_app.py index 9439895..af41062 100644 --- a/python3/sample_app.py +++ b/python3/sample_app.py @@ -61,8 +61,9 @@ def process_res(res): try: APPID = input('Please enter your app Id:\n') APPKEY = input('Please input your subscription key:\n') + REGION = input('Please input your region:\n') TEXT = input('Please input the text to predict:\n') - CLIENT = LUISClient(APPID, APPKEY, True) + CLIENT = LUISClient(APPID, APPKEY, REGION, True) res = CLIENT.predict(TEXT) while res.get_dialog() is not None and not res.get_dialog().is_finished(): TEXT = input('%s\n'%res.get_dialog().get_prompt()) diff --git a/python3/sample_app_async.py b/python3/sample_app_async.py index 17e48d9..ea947c8 100644 --- a/python3/sample_app_async.py +++ b/python3/sample_app_async.py @@ -71,8 +71,9 @@ def on_failure(err): try: APPID = input('Please enter your app Id:\n') APPKEY = input('Please input your subscription key:\n') + REGION = input('Please input your region:\n') TEXT = input('Please input the text to predict:\n') - CLIENT = LUISClient(APPID, APPKEY, True) + CLIENT = LUISClient(APPID, APPKEY, REGION, True) CLIENT.predict(TEXT, {'on_success': on_success, 'on_failure': on_failure}) print('-------\nMain thread finishing!!\n-------') except Exception as exc: From 9747030982d8824262c71542c7a831987ae66f02 Mon Sep 17 00:00:00 2001 From: mparnisari Date: Sun, 3 Dec 2017 18:39:53 -0800 Subject: [PATCH 2/5] Fixed typos in documentation --- python2/luis_sdk/luis_client.py | 9 ++++----- python3/luis_sdk/luis_client.py | 11 +++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/python2/luis_sdk/luis_client.py b/python2/luis_sdk/luis_client.py index 74acdc9..b28e826 100644 --- a/python2/luis_sdk/luis_client.py +++ b/python2/luis_sdk/luis_client.py @@ -81,7 +81,7 @@ def __init__(self, app_id, app_key, region, verbose=True): def predict(self, text, response_handlers=None, daemon=False): ''' Routes the prediction routine to either sync or async - based on the presence or absence of a callback fucntion. + based on the presence or absence of a callback function. :param text: the text to be analysed and predicted. :param response_handlers: a dictionary that contains two keys on_success and on_failure, whose values are two functions to be executed if async. @@ -135,7 +135,7 @@ def _predict_url_gen(self, text): ''' Returns the suitable LUIS API predict url. :param text: The text to be analysed and predicted. - :return: LUIS API predicton url. + :return: LUIS API prediction url. ''' return self._PredictMask%(self._app_id, self._app_key, quote(text), self._verbose) @@ -144,7 +144,6 @@ def _predict_async_helper(self, text, response_handlers): A wrapper function to be executed asynchronously in an external thread. It executes the predict routine and then executes a callback function. :param text: The text to be analysed and predicted. - :param response: A LUISResponse that contains the context Id. :param response_handlers: A dictionary that contains two keys on_success and on_failure, whose values are two functions to be executed if async. :return: None. @@ -160,7 +159,7 @@ def _predict_async_helper(self, text, response_handlers): def reply(self, text, response, response_handlers=None, force_set_parameter_name=None, daemon=False): ''' Routes the reply routine to either sync or async - based on the presence or absence of a callback fucntion. + based on the presence or absence of a callback function. :param text: The text to be analysed and predicted. :param response: A LUISResponse object that contains the context Id. :param response_handlers: A dictionary that contains two keys on_success and on_failure, @@ -186,7 +185,7 @@ def reply_sync(self, text, response, force_set_parameter_name=None): :param text: The text to be analysed and predicted. :param response: A LUISResponse object that contains the context Id. :param force_set_parameter_name: The name of a parameter the needs to be reset in dialog. - :return: A LUISResponse object containg the response data. + :return: A LUISResponse object containing the response data. ''' try: conn = httplib.HTTPSConnection(self._LUISURLMASK % self._region) diff --git a/python3/luis_sdk/luis_client.py b/python3/luis_sdk/luis_client.py index 33b8b0c..1b2116c 100644 --- a/python3/luis_sdk/luis_client.py +++ b/python3/luis_sdk/luis_client.py @@ -81,7 +81,7 @@ def __init__(self, app_id, app_key, region, verbose=True): def predict(self, text, response_handlers=None, daemon=False): ''' Routes the prediction routine to either sync or async - based on the presence or absence of a callback fucntion. + based on the presence or absence of a callback function. :param text: the text to be analysed and predicted. :param response_handlers: a dictionary that contains two keys on_success and on_failure, whose values are two functions to be executed if async. @@ -135,7 +135,7 @@ def _predict_url_gen(self, text): ''' Returns the suitable LUIS API predict url. :param text: The text to be analysed and predicted. - :return: LUIS API predicton url. + :return: LUIS API prediction url. ''' return self._PredictMask%(self._app_id, self._app_key, quote(text), self._verbose) @@ -144,7 +144,6 @@ def _predict_async_helper(self, text, response_handlers): A wrapper function to be executed asynchronously in an external thread. It executes the predict routine and then executes a callback function. :param text: The text to be analysed and predicted. - :param response: A LUISResponse object that contains the context Id. :param response_handlers: A dictionary that contains two keys on_success and on_failure, whose values are two functions to be executed if async. :return: None. @@ -160,7 +159,7 @@ def _predict_async_helper(self, text, response_handlers): def reply(self, text, response, response_handlers=None, force_set_parameter_name=None, daemon=False): ''' Routes the reply routine to either sync or async - based on the presence or absence of a callback fucntion. + based on the presence or absence of a callback function. :param text: The text to be analysed and predicted. :param response: A LUISResponse object that contains the context Id. :param response_handlers: A dictionary that contains two keys on_success and on_failure, @@ -186,7 +185,7 @@ def reply_sync(self, text, response, force_set_parameter_name): :param text: The text to be analysed and predicted. :param response: A LUISResponse object that contains the context Id. :param force_set_parameter_name: The name of a parameter the needs to be reset in dialog. - :return: A LUISResponse object containg the response data. + :return: A LUISResponse object containing the response data. ''' try: conn = http.client.HTTPSConnection(self._LUISURLMASK % self._region) @@ -232,7 +231,7 @@ def _reply_url_gen(self, text, response, force_set_parameter_name): url += '&forceset=%s'%(force_set_parameter_name) return url - def _reply_async_helper(self, text, response, response_handlers): + def _reply_async_helper(self, text, response, response_handlers, force_set_parameter_name): ''' A wrapper function to be executed asynchronously in an external thread. It executes the reply routine and then executes a callback function. From 3a7e5374cc076ac4fae40c9be745e506c5bb469d Mon Sep 17 00:00:00 2001 From: mparnisari Date: Sun, 3 Dec 2017 18:40:02 -0800 Subject: [PATCH 3/5] .gitignore --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index a36e2fb..92e5fa2 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,7 @@ lib64 # Installer logs pip-log.txt + +# IDEs +.idea +.vscode From 4f26fe2805ea173849cd9f728227e18f4ef69a5f Mon Sep 17 00:00:00 2001 From: mparnisari Date: Sun, 3 Dec 2017 19:02:35 -0800 Subject: [PATCH 4/5] Added parameter "use production slot" --- python2/luis_sdk/luis_client.py | 12 +++++++----- python2/luis_sdk/luis_response.py | 2 +- python2/sample_app.py | 2 +- python2/sample_app_async.py | 2 +- python3/luis_sdk/luis_client.py | 12 +++++++----- python3/luis_sdk/luis_response.py | 2 +- python3/sample_app.py | 2 +- python3/sample_app_async.py | 2 +- 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/python2/luis_sdk/luis_client.py b/python2/luis_sdk/luis_client.py index b28e826..8f52682 100644 --- a/python2/luis_sdk/luis_client.py +++ b/python2/luis_sdk/luis_client.py @@ -43,16 +43,17 @@ class LUISClient(object): Starts the prediction procedure for the user's text, and accepts a callback function ''' _LUISURLMASK = u'%s.api.cognitive.microsoft.com' - _PredictMask = u'/luis/v2.0/apps/%s?subscription-key=%s&q=%s&verbose=%s' - _ReplyMask = u'/luis/v2.0/apps/%s?subscription-key=%s&q=%s&contextid=%s&verbose=%s' + _PredictMask = u'/luis/v2.0/apps/%s?subscription-key=%s&q=%s&verbose=%s&staging=%s' + _ReplyMask = u'/luis/v2.0/apps/%s?subscription-key=%s&q=%s&contextid=%s&verbose=%s&staging=%s' - def __init__(self, app_id, app_key, region, verbose=True): + def __init__(self, app_id, app_key, region, verbose=True, use_production_slot=True): ''' A constructor for the LUISClient class. :param app_id: A string containing the application id. :param app_key: A string containing the subscription key. :param region: A string containing the region of the subscription. :param verbose: A boolean to indicate whether the verbose version should used or not. + :param use_production_slot: A boolean to indicate whether to use the production slot. ''' if app_id is None: raise TypeError(u'NULL App Id') @@ -77,6 +78,7 @@ def __init__(self, app_id, app_key, region, verbose=True): self._app_key = app_key self._region = region self._verbose = u'true' if verbose else u'false' + self._use_staging_slot = u'false' if use_production_slot else u'true' def predict(self, text, response_handlers=None, daemon=False): ''' @@ -137,7 +139,7 @@ def _predict_url_gen(self, text): :param text: The text to be analysed and predicted. :return: LUIS API prediction url. ''' - return self._PredictMask%(self._app_id, self._app_key, quote(text), self._verbose) + return self._PredictMask%(self._app_id, self._app_key, quote(text), self._verbose, self._use_staging_slot) def _predict_async_helper(self, text, response_handlers): ''' @@ -226,7 +228,7 @@ def _reply_url_gen(self, text, response, force_set_parameter_name): :return: LUIS API reply url. ''' url = self._ReplyMask%(self._app_id, self._app_key, quote(text) - , response.get_dialog().get_context_id(), self._verbose) + , response.get_dialog().get_context_id(), self._verbose, self._use_staging_slot) if force_set_parameter_name is not None: url += u'&forceset=%s'%(force_set_parameter_name) return url diff --git a/python2/luis_sdk/luis_response.py b/python2/luis_sdk/luis_response.py index 4adecd0..839992e 100644 --- a/python2/luis_sdk/luis_response.py +++ b/python2/luis_sdk/luis_response.py @@ -58,7 +58,7 @@ def __init__(self, JSONResponse): try: response = json.loads(JSONResponse) except Exception: - raise Exception(u'Error in parsing json') + raise Exception(u'Error in parsing json "%s"' % JSONResponse) else: response = JSONResponse diff --git a/python2/sample_app.py b/python2/sample_app.py index 8febd9d..4b3a8bd 100644 --- a/python2/sample_app.py +++ b/python2/sample_app.py @@ -63,7 +63,7 @@ def process_res(res): APPKEY = raw_input(u'Please input your subscription key:\n') REGION = raw_input(u'Please input your region:\n') TEXT = raw_input(u'Please input the text to predict:\n') - CLIENT = LUISClient(APPID, APPKEY, REGION, True) + CLIENT = LUISClient(APPID, APPKEY, REGION, True, True) res = CLIENT.predict(TEXT) while res.get_dialog() is not None and not res.get_dialog().is_finished(): TEXT = raw_input(u'%s\n'%res.get_dialog().get_prompt()) diff --git a/python2/sample_app_async.py b/python2/sample_app_async.py index 4a0c6f1..6e398f9 100644 --- a/python2/sample_app_async.py +++ b/python2/sample_app_async.py @@ -73,7 +73,7 @@ def on_failure(err): APPKEY = raw_input(u'Please input your subscription key:\n') REGION = raw_input(u'Please input your region:\n') TEXT = raw_input(u'Please input the text to predict:\n') - CLIENT = LUISClient(APPID, APPKEY, REGION, True) + CLIENT = LUISClient(APPID, APPKEY, REGION, True, True) CLIENT.predict(TEXT, {u'on_success': on_success, u'on_failure': on_failure}) print u'-------\nMain thread finishing!!\n-------' except Exception, exc: diff --git a/python3/luis_sdk/luis_client.py b/python3/luis_sdk/luis_client.py index 1b2116c..df3efdb 100644 --- a/python3/luis_sdk/luis_client.py +++ b/python3/luis_sdk/luis_client.py @@ -43,16 +43,17 @@ class LUISClient: Starts the prediction procedure for the user's text, and accepts a callback function ''' _LUISURLMASK = '%s.api.cognitive.microsoft.com' - _PredictMask = '/luis/v2.0/apps/%s?subscription-key=%s&q=%s&verbose=%s' - _ReplyMask = '/luis/v2.0/apps/%s?subscription-key=%s&q=%s&contextid=%s&verbose=%s' + _PredictMask = '/luis/v2.0/apps/%s?subscription-key=%s&q=%s&verbose=%s&staging=%s' + _ReplyMask = '/luis/v2.0/apps/%s?subscription-key=%s&q=%s&contextid=%s&verbose=%s&staging=%s' - def __init__(self, app_id, app_key, region, verbose=True): + def __init__(self, app_id, app_key, region, verbose=True, use_production_slot=True): ''' A constructor for the LUISClient class. :param app_id: A string containing the application id. :param app_key: A string containing the subscription key. :param region: A string containing the region of the subscription. :param verbose: A boolean to indicate whether the verbose version should used or not. + :param use_production_slot: A boolean to indicate whether to use the production slot. ''' if app_id is None: raise TypeError('NULL App Id') @@ -77,6 +78,7 @@ def __init__(self, app_id, app_key, region, verbose=True): self._app_key = app_key self._region = region self._verbose = 'true' if verbose else 'false' + self._use_staging_slot = 'false' if use_production_slot else 'true' def predict(self, text, response_handlers=None, daemon=False): ''' @@ -137,7 +139,7 @@ def _predict_url_gen(self, text): :param text: The text to be analysed and predicted. :return: LUIS API prediction url. ''' - return self._PredictMask%(self._app_id, self._app_key, quote(text), self._verbose) + return self._PredictMask%(self._app_id, self._app_key, quote(text), self._verbose, self._use_staging_slot) def _predict_async_helper(self, text, response_handlers): ''' @@ -226,7 +228,7 @@ def _reply_url_gen(self, text, response, force_set_parameter_name): :return: LUIS API reply url. ''' url = self._ReplyMask%(self._app_id, self._app_key, quote(text) - , response.get_dialog().get_context_id(), self._verbose) + , response.get_dialog().get_context_id(), self._verbose, self._use_staging_slot) if force_set_parameter_name is not None: url += '&forceset=%s'%(force_set_parameter_name) return url diff --git a/python3/luis_sdk/luis_response.py b/python3/luis_sdk/luis_response.py index 21c7721..a9487fd 100644 --- a/python3/luis_sdk/luis_response.py +++ b/python3/luis_sdk/luis_response.py @@ -58,7 +58,7 @@ def __init__(self, JSONResponse): try: response = json.loads(JSONResponse) except Exception: - raise Exception('Error in parsing json') + raise Exception('Error in parsing json "%s"' % JSONResponse) else: response = JSONResponse diff --git a/python3/sample_app.py b/python3/sample_app.py index af41062..256c3ef 100644 --- a/python3/sample_app.py +++ b/python3/sample_app.py @@ -63,7 +63,7 @@ def process_res(res): APPKEY = input('Please input your subscription key:\n') REGION = input('Please input your region:\n') TEXT = input('Please input the text to predict:\n') - CLIENT = LUISClient(APPID, APPKEY, REGION, True) + CLIENT = LUISClient(APPID, APPKEY, REGION, True, True) res = CLIENT.predict(TEXT) while res.get_dialog() is not None and not res.get_dialog().is_finished(): TEXT = input('%s\n'%res.get_dialog().get_prompt()) diff --git a/python3/sample_app_async.py b/python3/sample_app_async.py index ea947c8..d734c7d 100644 --- a/python3/sample_app_async.py +++ b/python3/sample_app_async.py @@ -73,7 +73,7 @@ def on_failure(err): APPKEY = input('Please input your subscription key:\n') REGION = input('Please input your region:\n') TEXT = input('Please input the text to predict:\n') - CLIENT = LUISClient(APPID, APPKEY, REGION, True) + CLIENT = LUISClient(APPID, APPKEY, REGION, True, True) CLIENT.predict(TEXT, {'on_success': on_success, 'on_failure': on_failure}) print('-------\nMain thread finishing!!\n-------') except Exception as exc: From 8ac32c04aaed307a8cef9b6a04f5af136de604b9 Mon Sep 17 00:00:00 2001 From: mparnisari Date: Sun, 3 Dec 2017 19:04:22 -0800 Subject: [PATCH 5/5] Fixed more typos in documentation --- python2/luis_sdk/luis_action.py | 2 +- python2/luis_sdk/luis_composite_entity_child.py | 2 +- python2/luis_sdk/luis_dialog.py | 2 +- python2/luis_sdk/luis_parametervalue.py | 4 ++-- python3/luis_sdk/luis_action.py | 2 +- python3/luis_sdk/luis_composite_entity_child.py | 2 +- python3/luis_sdk/luis_dialog.py | 2 +- python3/luis_sdk/luis_parametervalue.py | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python2/luis_sdk/luis_action.py b/python2/luis_sdk/luis_action.py index 0711ac4..cc5622e 100644 --- a/python2/luis_sdk/luis_action.py +++ b/python2/luis_sdk/luis_action.py @@ -60,7 +60,7 @@ def get_name(self): def get_triggered(self): ''' A getter for the action's triggered flag. - :return: A boolean that expresses whether the action was trigerred or not. + :return: A boolean that expresses whether the action was triggered or not. ''' return self._triggered diff --git a/python2/luis_sdk/luis_composite_entity_child.py b/python2/luis_sdk/luis_composite_entity_child.py index e56a14b..3d6ed4c 100644 --- a/python2/luis_sdk/luis_composite_entity_child.py +++ b/python2/luis_sdk/luis_composite_entity_child.py @@ -40,7 +40,7 @@ class LUISCompositeEntityChild: def __init__(self, composite_entity_child): ''' A constructor for the LUISCompositeEntityChild class. - :param composite_entity: A dictionary containing the composite entity child data. + :param composite_entity_child: A dictionary containing the composite entity child data. ''' self._type = composite_entity_child['type'] self._value = composite_entity_child['value'] diff --git a/python2/luis_sdk/luis_dialog.py b/python2/luis_sdk/luis_dialog.py index ffa6f69..f460f17 100644 --- a/python2/luis_sdk/luis_dialog.py +++ b/python2/luis_sdk/luis_dialog.py @@ -40,7 +40,7 @@ class LUISDialog(object): def __init__(self, dialog): ''' A constructor for the LUISDialog class. - :param action: A dictionary containing the dialog data. + :param dialog: A dictionary containing the dialog data. ''' if u'prompt' in dialog: self._prompt = dialog[u'prompt'] diff --git a/python2/luis_sdk/luis_parametervalue.py b/python2/luis_sdk/luis_parametervalue.py index ea01ead..643f685 100644 --- a/python2/luis_sdk/luis_parametervalue.py +++ b/python2/luis_sdk/luis_parametervalue.py @@ -33,8 +33,8 @@ class LUISParameterValue(object): ''' - LUIS Paramater Value Class. - Describes the LUIS Paramter Value structure. + LUIS Parameter Value Class. + Describes the LUIS Parameter Value structure. ''' def __init__(self, parameter_value): diff --git a/python3/luis_sdk/luis_action.py b/python3/luis_sdk/luis_action.py index ba5b638..091c9ee 100644 --- a/python3/luis_sdk/luis_action.py +++ b/python3/luis_sdk/luis_action.py @@ -60,7 +60,7 @@ def get_name(self): def get_triggered(self): ''' A getter for the action's triggered flag. - :return: A boolean that expresses whether the action was trigerred or not. + :return: A boolean that expresses whether the action was triggered or not. ''' return self._triggered diff --git a/python3/luis_sdk/luis_composite_entity_child.py b/python3/luis_sdk/luis_composite_entity_child.py index e56a14b..3d6ed4c 100644 --- a/python3/luis_sdk/luis_composite_entity_child.py +++ b/python3/luis_sdk/luis_composite_entity_child.py @@ -40,7 +40,7 @@ class LUISCompositeEntityChild: def __init__(self, composite_entity_child): ''' A constructor for the LUISCompositeEntityChild class. - :param composite_entity: A dictionary containing the composite entity child data. + :param composite_entity_child: A dictionary containing the composite entity child data. ''' self._type = composite_entity_child['type'] self._value = composite_entity_child['value'] diff --git a/python3/luis_sdk/luis_dialog.py b/python3/luis_sdk/luis_dialog.py index 6293191..77f2fd6 100644 --- a/python3/luis_sdk/luis_dialog.py +++ b/python3/luis_sdk/luis_dialog.py @@ -40,7 +40,7 @@ class LUISDialog: def __init__(self, dialog): ''' A constructor for the LUISDialog class. - :param action: A dictionary containing the dialog data. + :param dialog: A dictionary containing the dialog data. ''' if 'prompt' in dialog: self._prompt = dialog['prompt'] diff --git a/python3/luis_sdk/luis_parametervalue.py b/python3/luis_sdk/luis_parametervalue.py index 9a3b9af..1a681ff 100644 --- a/python3/luis_sdk/luis_parametervalue.py +++ b/python3/luis_sdk/luis_parametervalue.py @@ -33,8 +33,8 @@ class LUISParameterValue: ''' - LUIS Paramater Value Class. - Describes the LUIS Paramter Value structure. + LUIS Parameter Value Class. + Describes the LUIS Parameter Value structure. ''' def __init__(self, parameter_value):