dxmt-python-sdk 1.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dxmt/py.typed ADDED
File without changes
dxmt/types.py ADDED
@@ -0,0 +1,51 @@
1
+ """DXMT Python SDK Type Definitions.
2
+
3
+ This module defines type aliases and data structures used throughout the SDK.
4
+ """
5
+
6
+ from typing import Any, Literal, Union
7
+
8
+ from typing_extensions import TypeAlias
9
+
10
+ from . import filters as _filters
11
+
12
+ # Vector types
13
+ DenseVector: TypeAlias = list[float]
14
+ SparseVector: TypeAlias = dict[int, float]
15
+
16
+ # Distance metrics
17
+ DistanceMetric: TypeAlias = Literal["cosine", "euclidean", "manhattan", "dot"]
18
+
19
+ # Index types
20
+ IndexType: TypeAlias = Literal[
21
+ "hnsw", "ivf", "ivf_pq", "lsh", "brute_force", "optimized"
22
+ ]
23
+
24
+ # Insert modes
25
+ InsertMode: TypeAlias = Literal[
26
+ "standard",
27
+ "lock_free",
28
+ "streaming",
29
+ "deferred_index",
30
+ "ultimate",
31
+ "batch",
32
+ "parallel",
33
+ "chunked",
34
+ "async_write",
35
+ "bulk",
36
+ ]
37
+
38
+ # Quantization types
39
+ QuantizationType: TypeAlias = Literal["scalar", "product", "binary"]
40
+
41
+ # Record structure
42
+ Record: TypeAlias = dict[str, Any]
43
+
44
+ # Search result structure
45
+ SearchResult: TypeAlias = dict[str, Any]
46
+
47
+ # Table configuration
48
+ TableConfig: TypeAlias = dict[str, Any]
49
+
50
+ # Filter structure: the server's dict shape, a MongoDB-style dict, or a `Field` expression
51
+ Filter: TypeAlias = Union[dict[str, Any], _filters.Filter]