2626 CreateDataDefaults ,
2727 CreateRoleDefaults ,
2828 PERMISSION_HELP_STRING ,
29+ MAX_WORKERS ,
2930)
3031
3132
@@ -89,7 +90,7 @@ def create() -> None:
8990@click .option (
9091 "--training_limit" ,
9192 default = CreateCollectionDefaults .training_limit ,
92- help = "Training limit for PQ and SQ (default: 10000 )." ,
93+ help = f "Training limit for PQ and SQ (default: { CreateCollectionDefaults . training_limit } )." ,
9394)
9495@click .option (
9596 "--multitenant" , is_flag = True , help = "Enable multitenancy (default: False)."
@@ -228,7 +229,7 @@ def create_collection_cli(
228229@click .option (
229230 "--number_tenants" ,
230231 default = CreateTenantsDefaults .number_tenants ,
231- help = "Number of tenants to create (default: 100 )." ,
232+ help = f "Number of tenants to create (default: { CreateTenantsDefaults . number_tenants } )." ,
232233)
233234@click .option (
234235 "--tenant_batch_size" ,
@@ -336,7 +337,8 @@ def create_backup_cli(ctx, backend, backup_id, include, exclude, wait, cpu_for_b
336337@click .option (
337338 "--limit" ,
338339 default = CreateDataDefaults .limit ,
339- help = "Number of objects to import (default: 1000)." ,
340+ help = f"Number of objects to import (default: { CreateDataDefaults .limit } )." ,
341+ type = int ,
340342)
341343@click .option (
342344 "--consistency_level" ,
@@ -390,6 +392,23 @@ def create_backup_cli(ctx, backend, backup_id, include, exclude, wait, cpu_for_b
390392 is_flag = True ,
391393 help = "Enable multi-vector (default: False)." ,
392394)
395+ @click .option (
396+ "--dynamic_batch" ,
397+ is_flag = True ,
398+ help = "Enable dynamic batching (default: False)." ,
399+ )
400+ @click .option (
401+ "--batch_size" ,
402+ default = CreateDataDefaults .batch_size ,
403+ help = f"Number of objects to ingest in each batch (default: { CreateDataDefaults .batch_size } )." ,
404+ type = int ,
405+ )
406+ @click .option (
407+ "--concurrent_requests" ,
408+ default = MAX_WORKERS ,
409+ type = int ,
410+ help = f"Number of concurrent requests to send to the server (default: { MAX_WORKERS } )." ,
411+ )
393412@click .pass_context
394413def create_data_cli (
395414 ctx ,
@@ -406,6 +425,9 @@ def create_data_cli(
406425 wait_for_indexing ,
407426 verbose ,
408427 multi_vector ,
428+ dynamic_batch ,
429+ batch_size ,
430+ concurrent_requests ,
409431):
410432 """Ingest data into a collection in Weaviate."""
411433
@@ -423,6 +445,12 @@ def create_data_cli(
423445 click .echo ("Error: --uuid has no effect unless --limit=1 is enabled." )
424446 sys .exit (1 )
425447
448+ if dynamic_batch and not randomize :
449+ click .echo (
450+ "Error: --dynamic_batch has no effect unless --randomize is enabled."
451+ )
452+ sys .exit (1 )
453+
426454 client : Optional [WeaviateClient ] = None
427455 try :
428456 client = get_client_from_context (ctx )
@@ -442,6 +470,9 @@ def create_data_cli(
442470 wait_for_indexing = wait_for_indexing ,
443471 verbose = verbose ,
444472 multi_vector = multi_vector ,
473+ dynamic_batch = dynamic_batch ,
474+ batch_size = batch_size ,
475+ concurrent_requests = concurrent_requests ,
445476 )
446477 except Exception as e :
447478 click .echo (f"Error: { e } " )
0 commit comments