docarray.document.mixins.sugar module#

class docarray.document.mixins.sugar.SingletonSugarMixin[source]#

Bases: object

Provide sugary syntax for Document by inheriting methods from DocumentArray

match(darray: DocumentArray, metric: Union[str, Callable[[ArrayType, ArrayType], np.ndarray]] = 'cosine', limit: Optional[Union[int, float]] = 20, normalization: Optional[Tuple[float, float]] = None, metric_name: Optional[str] = None, batch_size: Optional[int] = None, exclude_self: bool = False, only_id: bool = False, use_scipy: bool = False, num_worker: Optional[int] = 1) T[source]#
Return type

T

embed(embed_model: AnyDNN, device: str = 'cpu', batch_size: int = 256) T[source]#
Return type

T

post(*args, **kwargs)[source]#
Return type

T