0.9.1 (latest) 0.9.0 0.8.2 0.7.0 0.6.0 0.5.0 0.4.1 0.3.0 API documentation for `vector_store` module.

## Classes

### [DialectSemantics](https://docs.cloud.google.com/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.DialectSemantics)

    DialectSemantics()

Abstract base class for dialect semantics.

### [DistanceStrategy](https://docs.cloud.google.com/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.DistanceStrategy)

    DistanceStrategy(value)

Enum for distance calculation strategies.

### [GoogleSqlSemantics](https://docs.cloud.google.com/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.GoogleSqlSemantics)

    GoogleSqlSemantics()

Implementation of dialect semantics for Google SQL.

### [PGSqlSemantics](https://docs.cloud.google.com/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.PGSqlSemantics)

    PGSqlSemantics()

Implementation of dialect semantics for PostgreSQL.

### [QueryParameters](https://docs.cloud.google.com/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.QueryParameters)

    QueryParameters(
        algorithm=NearestNeighborsAlgorithm.EXACT_NEAREST_NEIGHBOR,
        distance_strategy=DistanceStrategy.EUCLIDEAN,
        read_timestamp: typing.Optional[datetime.datetime] = None,
        min_read_timestamp: typing.Optional[datetime.datetime] = None,
        max_staleness: typing.Optional[datetime.timedelta] = None,
        exact_staleness: typing.Optional[datetime.timedelta] = None,
    )

Class representing query parameters for nearest neighbors search.

### [SpannerVectorStore](https://docs.cloud.google.com/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.SpannerVectorStore)

    SpannerVectorStore(
        instance_id: str,
        database_id: str,
        table_name: str,
        embedding_service: langchain_core.embeddings.embeddings.Embeddings,
        id_column: str = "langchain_id",
        content_column: str = "content",
        embedding_column: typing.Optional[
            typing.Union[str, langchain_google_spanner.vector_store.TableColumn]
        ] = None,
        client: typing.Optional[google.cloud.spanner_v1.client.Client] = None,
        metadata_columns: typing.Optional[typing.List[str]] = None,
        ignore_metadata_columns: typing.Optional[typing.List[str]] = None,
        metadata_json_column: typing.Optional[str] = None,
        vector_index_name: typing.Optional[str] = None,
        query_parameters: langchain_google_spanner.vector_store.QueryParameters = langchain_google_spanner.vector_store.QueryParameters,
    )

Initialize the SpannerVectorStore.

Parameters:

- instance_id (str): The ID of the Spanner instance.
- database_id (str): The ID of the Spanner database.
- table_name (str): The name of the table.
- embedding_service (Embeddings): The embedding service.
- id_column (str): The name of the row ID column. Defaults to ID_COLUMN_NAME.
- content_column (str): The name of the content column. Defaults to CONTENT_COLUMN_NAME.
- embedding_column (str): The name of the embedding column. Defaults to EMBEDDING_COLUMN_NAME.
- client (Client): The Spanner client. Defaults to Client().
- metadata_columns (Optional\[List\[str\]\]): List of metadata columns. Defaults to None.
- ignore_metadata_columns (Optional\[List\[str\]\]): List of metadata columns to ignore. Defaults to None.
- metadata_json_column (Optional\[str\]): The generic metadata column. Defaults to None.
- query_parameters (QueryParameters): The query parameters. Defaults to QueryParameters().

### [TableColumn](https://docs.cloud.google.com/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.TableColumn)

    TableColumn(
        name: str,
        type: str,
        is_null: bool = True,
        vector_length: typing.Optional[int] = None,
    )

Represents column configuration, to be used as part of create DDL statement for table creation.

### [VectorSearchIndex](https://docs.cloud.google.com/python/docs/reference/langchain-google-spanner/latest/langchain_google_spanner.vector_store.VectorSearchIndex)

    VectorSearchIndex(
        num_leaves: int,
        num_branches: int,
        tree_depth: int,
        distance_type: langchain_google_spanner.vector_store.DistanceStrategy,
        nullable_column: bool = False,
        *args,
        **kwargs
    )

The index for use with Approximate Nearest Neighbor (ANN) vector search.