Skip to content

Commit

Permalink
fix(nlu): require training_data_content_type
Browse files Browse the repository at this point in the history
  • Loading branch information
apaparazzi0329 committed Mar 17, 2023
1 parent 37aa172 commit d91f007
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ibm_watson/natural_language_understanding_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ def delete_model(self, model_id: str, **kwargs) -> DetailedResponse:
def create_categories_model(self,
language: str,
training_data: BinaryIO,
training_data_content_type: str,
*,
training_data_content_type: str = None,
name: str = None,
description: str = None,
model_version: str = None,
Expand Down Expand Up @@ -325,6 +325,8 @@ def create_categories_model(self,
raise ValueError('language must be provided')
if training_data is None:
raise ValueError('training_data must be provided')
if not training_data_content_type:
raise ValueError('training_data_content_type must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
Expand Down Expand Up @@ -449,8 +451,8 @@ def update_categories_model(self,
model_id: str,
language: str,
training_data: BinaryIO,
training_data_content_type: str,
*,
training_data_content_type: str = None,
name: str = None,
description: str = None,
model_version: str = None,
Expand Down Expand Up @@ -487,6 +489,8 @@ def update_categories_model(self,
raise ValueError('language must be provided')
if training_data is None:
raise ValueError('training_data must be provided')
if not training_data_content_type:
raise ValueError('training_data_content_type must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
Expand Down Expand Up @@ -585,8 +589,8 @@ def create_classifications_model(
self,
language: str,
training_data: BinaryIO,
training_data_content_type: str,
*,
training_data_content_type: str = None,
name: str = None,
description: str = None,
model_version: str = None,
Expand Down Expand Up @@ -625,6 +629,8 @@ def create_classifications_model(
raise ValueError('language must be provided')
if training_data is None:
raise ValueError('training_data must be provided')
if not training_data_content_type:
raise ValueError('training_data_content_type must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
Expand Down Expand Up @@ -757,8 +763,8 @@ def update_classifications_model(
model_id: str,
language: str,
training_data: BinaryIO,
training_data_content_type: str,
*,
training_data_content_type: str = None,
name: str = None,
description: str = None,
model_version: str = None,
Expand Down Expand Up @@ -799,6 +805,8 @@ def update_classifications_model(
raise ValueError('language must be provided')
if training_data is None:
raise ValueError('training_data must be provided')
if not training_data_content_type:
raise ValueError('training_data_content_type must be provided')
headers = {}
sdk_headers = get_sdk_headers(
service_name=self.DEFAULT_SERVICE_NAME,
Expand Down

0 comments on commit d91f007

Please sign in to comment.