Module indexes (0.2.3)

API documentation for indexes module.

Classes

DistanceMeasure

DistanceMeasure(value)

Enumerates the types of distance measures that can be used in searches.

Squared L2 norm (Euclidean) distance.

IndexType

IndexType(value)

Defines the types of indexes that can be used for vector storage.

A tree-based index, specifically Annoy (Approximate Nearest Neighbors Oh Yeah).

QueryOptions

QueryOptions(
    num_partitions: typing.Optional[int] = None,
    num_neighbors: int = 10,
    distance_measure: langchain_google_cloud_sql_mysql.indexes.DistanceMeasure = DistanceMeasure.L2_SQUARED,
    search_type: langchain_google_cloud_sql_mysql.indexes.SearchType = SearchType.KNN,
)

Holds configuration options for executing a search query.

SearchType

SearchType(value)

Defines the types of search algorithms that can be used.

Approximate Nearest Neighbors search.

VectorIndex

VectorIndex(
    name: typing.Optional[str] = None,
    index_type: typing.Optional[
        langchain_google_cloud_sql_mysql.indexes.IndexType
    ] = None,
    distance_measure: typing.Optional[
        langchain_google_cloud_sql_mysql.indexes.DistanceMeasure
    ] = None,
    num_partitions: typing.Optional[int] = None,
    num_neighbors: typing.Optional[int] = None,
)

Represents a vector index for storing and querying vectors.