Skip to content

Commit ddf2e46

Browse files
author
Nitin Kanukolanu
committed
chore(fields) formatting
1 parent 64d3954 commit ddf2e46

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

redisvl/schema/fields.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class VectorIndexAlgorithm(str, Enum):
5656

5757
class CompressionType(str, Enum):
5858
"""Vector compression types for SVS-VAMANA algorithm"""
59+
5960
LVQ4 = "LVQ4"
6061
LVQ4x4 = "LVQ4x4"
6162
LVQ4x8 = "LVQ4x8"
@@ -182,10 +183,12 @@ class HNSWVectorFieldAttributes(BaseVectorFieldAttributes):
182183
"""Relative factor that sets the boundaries in which a range query may search for candidates"""
183184

184185

185-
186186
class SVSVectorFieldAttributes(BaseVectorFieldAttributes):
187187
"""SVS-VAMANA vector field attributes with optional compression support"""
188-
algorithm: Literal[VectorIndexAlgorithm.SVS_VAMANA] = VectorIndexAlgorithm.SVS_VAMANA
188+
189+
algorithm: Literal[VectorIndexAlgorithm.SVS_VAMANA] = (
190+
VectorIndexAlgorithm.SVS_VAMANA
191+
)
189192
"""The indexing algorithm for the vector field"""
190193

191194
# SVS-VAMANA graph parameters
@@ -206,7 +209,7 @@ class SVSVectorFieldAttributes(BaseVectorFieldAttributes):
206209
training_threshold: Optional[int] = None
207210
"""Minimum number of vectors required before compression training"""
208211

209-
@model_validator(mode='after')
212+
@model_validator(mode="after")
210213
def validate_svs_params(self):
211214
"""Validate SVS-VAMANA specific constraints"""
212215
# Datatype validation: SVS only supports FLOAT16 and FLOAT32
@@ -237,6 +240,8 @@ def validate_svs_params(self):
237240
# )
238241

239242
return self
243+
244+
240245
### Field Classes ###
241246

242247

@@ -455,12 +460,13 @@ def as_redis_field(self) -> RedisField:
455460

456461
class SVSVectorField(BaseField):
457462
"""Vector field with an SVS-VAMANA index"""
463+
458464
type: Literal[FieldTypes.VECTOR] = FieldTypes.VECTOR
459465
attrs: SVSVectorFieldAttributes
460466

461467
def as_redis_field(self) -> RedisField:
462468
name, as_name = self._handle_names()
463-
field_data=self.attrs.field_data
469+
field_data = self.attrs.field_data
464470
field_data.update(
465471
{
466472
"GRAPH_MAX_DEGREE": self.attrs.graph_max_degree,

0 commit comments

Comments
 (0)