""" This module contains the basic data types of Zvec """ from __future__ import annotations import typing __all__: list[str] = [ "DataType", "IndexType", "MetricType", "QuantizeType", "Status", "StatusCode", ] class DataType: """ Enumeration of supported data types in Zvec. Includes scalar types, dense/sparse vector types, and array types. Examples: >>> import zvec >>> print(zvec.DataType.FLOAT) DataType.FLOAT >>> print(zvec.DataType.VECTOR_FP32) DataType.VECTOR_FP32 Members: STRING BOOL INT32 INT64 FLOAT DOUBLE UINT32 UINT64 VECTOR_FP16 VECTOR_FP32 VECTOR_FP64 VECTOR_INT8 SPARSE_VECTOR_FP32 SPARSE_VECTOR_FP16 ARRAY_STRING ARRAY_INT32 ARRAY_INT64 ARRAY_FLOAT ARRAY_DOUBLE ARRAY_BOOL ARRAY_UINT32 ARRAY_UINT64 """ ARRAY_BOOL: typing.ClassVar[DataType] # value = ARRAY_DOUBLE: typing.ClassVar[DataType] # value = ARRAY_FLOAT: typing.ClassVar[DataType] # value = ARRAY_INT32: typing.ClassVar[DataType] # value = ARRAY_INT64: typing.ClassVar[DataType] # value = ARRAY_STRING: typing.ClassVar[DataType] # value = ARRAY_UINT32: typing.ClassVar[DataType] # value = ARRAY_UINT64: typing.ClassVar[DataType] # value = BOOL: typing.ClassVar[DataType] # value = DOUBLE: typing.ClassVar[DataType] # value = FLOAT: typing.ClassVar[DataType] # value = INT32: typing.ClassVar[DataType] # value = INT64: typing.ClassVar[DataType] # value = SPARSE_VECTOR_FP16: typing.ClassVar[ DataType ] # value = SPARSE_VECTOR_FP32: typing.ClassVar[ DataType ] # value = STRING: typing.ClassVar[DataType] # value = UINT32: typing.ClassVar[DataType] # value = UINT64: typing.ClassVar[DataType] # value = VECTOR_FP16: typing.ClassVar[DataType] # value = VECTOR_FP32: typing.ClassVar[DataType] # value = VECTOR_FP64: typing.ClassVar[DataType] # value = VECTOR_INT8: typing.ClassVar[DataType] # value = __members__: typing.ClassVar[ dict[str, DataType] ] # value = {'STRING': , 'BOOL': , 'INT32': , 'INT64': , 'FLOAT': , 'DOUBLE': , 'UINT32': , 'UINT64': , 'VECTOR_FP16': , 'VECTOR_FP32': , 'VECTOR_FP64': , 'VECTOR_INT8': , 'SPARSE_VECTOR_FP32': , 'SPARSE_VECTOR_FP16': , 'ARRAY_STRING': , 'ARRAY_INT32': , 'ARRAY_INT64': , 'ARRAY_FLOAT': , 'ARRAY_DOUBLE': , 'ARRAY_BOOL': , 'ARRAY_UINT32': , 'ARRAY_UINT64': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class IndexType: """ Enumeration of supported index types in Zvec. Examples: >>> import zvec >>> print(zvec.IndexType.HNSW) IndexType.HNSW Members: UNDEFINED HNSW IVF FLAT INVERT """ FLAT: typing.ClassVar[IndexType] # value = HNSW: typing.ClassVar[IndexType] # value = INVERT: typing.ClassVar[IndexType] # value = IVF: typing.ClassVar[IndexType] # value = UNDEFINED: typing.ClassVar[IndexType] # value = __members__: typing.ClassVar[ dict[str, IndexType] ] # value = {'UNDEFINED': , 'HNSW': , 'IVF': , 'FLAT': , 'INVERT': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class MetricType: """ Enumeration of supported distance/similarity metrics. - COSINE: Cosine similarity. - IP: Inner product (dot product). - L2: Euclidean distance (L2 norm). Examples: >>> import zvec >>> print(zvec.MetricType.COSINE) MetricType.COSINE Members: COSINE IP L2 """ COSINE: typing.ClassVar[MetricType] # value = IP: typing.ClassVar[MetricType] # value = L2: typing.ClassVar[MetricType] # value = __members__: typing.ClassVar[ dict[str, MetricType] ] # value = {'COSINE': , 'IP': , 'L2': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class QuantizeType: """ Enumeration of supported quantization types for vector compression. Examples: >>> import zvec >>> print(zvec.QuantizeType.INT8) QuantizeType.INT8 Members: UNDEFINED FP16 INT8 INT4 """ FP16: typing.ClassVar[QuantizeType] # value = INT4: typing.ClassVar[QuantizeType] # value = INT8: typing.ClassVar[QuantizeType] # value = UNDEFINED: typing.ClassVar[QuantizeType] # value = __members__: typing.ClassVar[ dict[str, QuantizeType] ] # value = {'UNDEFINED': , 'FP16': , 'INT8': , 'INT4': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ... class Status: """ Represents the outcome of a Zvec operation. A `Status` object is either OK (success) or carries an error code and message. Examples: >>> from zvec.typing import Status, StatusCode >>> s = Status() >>> print(s.ok()) True >>> s = Status(StatusCode.INVALID_ARGUMENT, "Field not found") >>> print(s.code() == StatusCode.INVALID_ARGUMENT) True >>> print(s.message()) Field not found """ __hash__: typing.ClassVar[None] = None @staticmethod def AlreadyExists(message: str) -> Status: ... @staticmethod def InternalError(message: str) -> Status: ... @staticmethod def InvalidArgument(message: str) -> Status: ... @staticmethod def NotFound(message: str) -> Status: ... @staticmethod def OK() -> Status: """ Create an OK status. """ @staticmethod def PermissionDenied(message: str) -> Status: ... def __eq__(self, arg0: Status) -> bool: ... @typing.overload def __init__(self) -> None: ... @typing.overload def __init__(self, code: StatusCode, message: str = "") -> None: """ Construct a status with the given code and optional message. Args: code (StatusCode): The status code. message (str, optional): Error message. Defaults to empty string. """ def __ne__(self, arg0: Status) -> bool: ... def __repr__(self) -> str: ... def code(self) -> StatusCode: """ StatusCode: Returns the status code. """ def message(self) -> str: """ str: Returns the error message (may be empty). """ def ok(self) -> bool: """ bool: Returns True if the status is OK. """ class StatusCode: """ Enumeration of possible status codes for Zvec operations. Used by the `Status` class to indicate success or failure reason. Members: OK NOT_FOUND ALREADY_EXISTS INVALID_ARGUMENT PERMISSION_DENIED FAILED_PRECONDITION RESOURCE_EXHAUSTED UNAVAILABLE INTERNAL_ERROR NOT_SUPPORTED UNKNOWN """ ALREADY_EXISTS: typing.ClassVar[ StatusCode ] # value = FAILED_PRECONDITION: typing.ClassVar[ StatusCode ] # value = INTERNAL_ERROR: typing.ClassVar[ StatusCode ] # value = INVALID_ARGUMENT: typing.ClassVar[ StatusCode ] # value = NOT_FOUND: typing.ClassVar[StatusCode] # value = NOT_SUPPORTED: typing.ClassVar[StatusCode] # value = OK: typing.ClassVar[StatusCode] # value = PERMISSION_DENIED: typing.ClassVar[ StatusCode ] # value = RESOURCE_EXHAUSTED: typing.ClassVar[ StatusCode ] # value = UNAVAILABLE: typing.ClassVar[StatusCode] # value = UNKNOWN: typing.ClassVar[StatusCode] # value = __members__: typing.ClassVar[ dict[str, StatusCode] ] # value = {'OK': , 'NOT_FOUND': , 'ALREADY_EXISTS': , 'INVALID_ARGUMENT': , 'PERMISSION_DENIED': , 'FAILED_PRECONDITION': , 'RESOURCE_EXHAUSTED': , 'UNAVAILABLE': , 'INTERNAL_ERROR': , 'NOT_SUPPORTED': , 'UNKNOWN': } def __eq__(self, other: typing.Any) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... def __index__(self) -> int: ... def __init__(self, value: typing.SupportsInt) -> None: ... def __int__(self) -> int: ... def __ne__(self, other: typing.Any) -> bool: ... def __repr__(self) -> str: ... def __setstate__(self, state: typing.SupportsInt) -> None: ... def __str__(self) -> str: ... @property def name(self) -> str: ... @property def value(self) -> int: ...