Skip to main content
Version: 0.6

vector_index

superduper.components.vector_index

Source code

ibatch​

ibatch(iterable: Iterable[~T],
batch_size: int) -> Iterator[List[~T]]
ParameterDescription
iterablethe iterable to batch
batch_sizethe number of groups to write

Batch an iterable into chunks of size batch_size.

VectorIndex​

VectorIndex(self,
identifier: str,
upstream: Optional[List[ForwardRef('Component')]] = None,
db: dataclasses.InitVar[typing.Optional[ForwardRef('Datalayer')]] = None,
*,
cdc_table: str = '',
indexing_listener: superduper.components.listener.Listener,
compatible_listener: Optional[superduper.components.listener.Listener] = None,
measure: str = 'cosine',
metric_values: Optional[Dict] = <factory>) -> None
ParameterDescription
identifierIdentifier of the instance.
upstreamA list of upstream components.
dbDatalayer instance. Datalayer instance.
cdc_tableTable to use for CDC
indexing_listenerListener which is applied to created vectors
compatible_listenerListener which is applied to vectors to be compared
measureMeasure to use for comparison
metric_valuesMetric values for this index

A component carrying the information to apply a vector index.