1111 run ,
1212)
1313from .. import DB
14- from .config import S3VectorsIndexConfig
1514from ..api import MetricType
15+ from .config import S3VectorsIndexConfig
1616
1717
1818class S3VectorsTypedDict (TypedDict ):
19- region_name : Annotated [str , click .option ("--region" , type = str , help = "AWS region for S3 bucket (eg. us-east-1)" , default = "us-east-1" )]
19+ region_name : Annotated [
20+ str , click .option ("--region" , type = str , help = "AWS region for S3 bucket (eg. us-east-1)" , default = "us-east-1" )
21+ ]
2022 access_key_id : Annotated [str , click .option ("--access_key_id" , type = str , help = "AWS access key ID" , required = True )]
21- secret_access_key : Annotated [str , click .option ("--secret_access_key" , type = str , help = "AWS secret access key" , required = True )]
23+ secret_access_key : Annotated [
24+ str , click .option ("--secret_access_key" , type = str , help = "AWS secret access key" , required = True )
25+ ]
2226
2327 bucket : Annotated [str , click .option ("--bucket" , type = str , help = "S3 bucket name" , required = True )]
2428 index : Annotated [str , click .option ("--index" , type = str , help = "Unique vector index name" , default = "vdbbench-index" )]
2529
26- metric : Annotated [str , click .option ("--metric" , type = str , help = "Distance metric for vector similarity (e.g., 'cosine', 'euclidean')." , default = None )]
30+ metric : Annotated [
31+ str ,
32+ click .option (
33+ "--metric" ,
34+ type = str ,
35+ help = "Distance metric for vector similarity (e.g., 'cosine', 'euclidean')." ,
36+ default = None ,
37+ ),
38+ ]
2739
2840
2941class S3VectorsIndexTypedDict (CommonTypedDict , S3VectorsTypedDict ): ...
@@ -45,8 +57,11 @@ def S3Vectors(**parameters: Unpack[S3VectorsIndexTypedDict]):
4557 index_name = parameters ["index" ] if parameters ["index" ] else "vdbbench-index" ,
4658 ),
4759 db_case_config = S3VectorsIndexConfig (
48- metric_type = MetricType .COSINE if parameters ["metric" ] == "cosine" else MetricType .L2 if parameters ["metric" ] == "l2" else None
60+ metric_type = (
61+ MetricType .COSINE
62+ if parameters ["metric" ] == "cosine"
63+ else MetricType .L2 if parameters ["metric" ] == "l2" else None
64+ )
4965 ),
5066 ** parameters ,
5167 )
52-
0 commit comments