Skip to content

Commit c04a3a0

Browse files
committed
provide validation for dataset_name and id
1 parent 47a5099 commit c04a3a0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

libs/labelbox/src/labelbox/client.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,9 @@ def create_prompt_response_generation_project(self,
891891
**kwargs: Additional parameters to pass see the create_project method
892892
Returns:
893893
Project: The created project
894-
894+
895+
NOTE: Only a dataset_name or dataset_id should be included
896+
895897
Examples:
896898
>>> client.create_prompt_response_generation_project(name=project_name, dataset_name="new data set", project_kind=MediaType.LLMPromptResponseCreation)
897899
>>> This creates a new dataset with a default number of rows (100), creates new project and assigns a batch of the newly created datarows to the project.
@@ -908,8 +910,14 @@ def create_prompt_response_generation_project(self,
908910
"""
909911
if not dataset_id and not dataset_name:
910912
raise ValueError(
911-
"dataset_name or data_set_id must be present and not be an empty string."
913+
"dataset_name or dataset_id must be present and not be an empty string."
912914
)
915+
916+
if dataset_id and dataset_name:
917+
raise ValueError(
918+
"Only provide a dataset_name or dataset_id, not both."
919+
)
920+
913921
if data_row_count <= 0:
914922
raise ValueError("data_row_count must be a positive integer.")
915923

0 commit comments

Comments
 (0)