Skip to content

Commit 1df5fe0

Browse files
committed
fix(types): move hnsw params class above ref
1 parent aabd06d commit 1df5fe0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/typesense/types/collection.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@
3636
Locales = typing.Literal["ja", "zh", "ko", "th", "el", "ru", "rs", "uk", "be", ""]
3737

3838

39+
class HNSWParamsSchema(typing.TypedDict):
40+
"""
41+
The schema for the HNSW parameters in the CollectionFieldSchema.
42+
43+
Attributes:
44+
M (int): The number of bi-directional links created for every new element.
45+
ef_construction (int): The size of the dynamic list for the nearest neighbors.
46+
"""
47+
48+
M: typing.NotRequired[int]
49+
ef_construction: typing.NotRequired[int]
50+
51+
3952
class CollectionFieldSchema(typing.Generic[_TType], typing.TypedDict, total=False):
4053
"""
4154
CollectionFieldSchema represents the schema of a field in a collection.
@@ -76,19 +89,6 @@ class CollectionFieldSchema(typing.Generic[_TType], typing.TypedDict, total=Fals
7689
vec_dist: typing.NotRequired[typing.Union[typing.Literal["cosine", "ip"], str]]
7790

7891

79-
class HNSWParamsSchema(typing.TypedDict):
80-
"""
81-
The schema for the HNSW parameters in the CollectionFieldSchema.
82-
83-
Attributes:
84-
M (int): The number of bi-directional links created for every new element.
85-
ef_construction (int): The size of the dynamic list for the nearest neighbors.
86-
"""
87-
88-
M: typing.NotRequired[int]
89-
ef_construction: typing.NotRequired[int]
90-
91-
9292
class RegularCollectionFieldSchema(CollectionFieldSchema[_FieldType]):
9393
"""
9494
The schema of a regular field in a collection.

0 commit comments

Comments
 (0)