Skip to content

Commit 548af69

Browse files
committed
provide validation for dataset_name and id
1 parent 11720ae commit 548af69

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
@@ -889,7 +889,9 @@ def create_prompt_response_generation_project(self,
889889
**kwargs: Additional parameters to pass see the create_project method
890890
Returns:
891891
Project: The created project
892-
892+
893+
NOTE: Only a dataset_name or dataset_id should be included
894+
893895
Examples:
894896
>>> client.create_prompt_response_generation_project(name=project_name, dataset_name="new data set", project_kind=MediaType.LLMPromptResponseCreation)
895897
>>> 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.
@@ -906,8 +908,14 @@ def create_prompt_response_generation_project(self,
906908
"""
907909
if not dataset_id and not dataset_name:
908910
raise ValueError(
909-
"dataset_name or data_set_id must be present and not be an empty string."
911+
"dataset_name or dataset_id must be present and not be an empty string."
910912
)
913+
914+
if dataset_id and dataset_name:
915+
raise ValueError(
916+
"Only provide a dataset_name or dataset_id, not both."
917+
)
918+
911919
if data_row_count <= 0:
912920
raise ValueError("data_row_count must be a positive integer.")
913921

0 commit comments

Comments
 (0)