Module vector_store (0.4.1)

API documentation for vector_store module.

Classes

DialectSemantics

DialectSemantics()

Abstract base class for dialect semantics.

DistanceStrategy

DistanceStrategy(value)

Enum for distance calculation strategies.

GoogleSqlSemnatics

GoogleSqlSemnatics()

Implementation of dialect semantics for Google SQL.

PGSqlSemnatics

PGSqlSemnatics()

Implementation of dialect semantics for PostgreSQL.

QueryParameters

QueryParameters(
    algorithm=NearestNeighborsAlgorithm.EXACT_NEAREST_NEIGHBOR,
    distance_strategy=DistanceStrategy.EUCLIDEIAN,
    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.

SecondaryIndex

SecondaryIndex(
    index_name: "str",
    columns: "list[str]",
    storing_columns: "Optional[list[str]]" = None,
)

SecondaryIndex(index_name: 'str', columns: 'list[str]', storing_columns: 'Optional[list[str]]' = None)

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: str = 'embedding', 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, query_parameters: langchain_google_spanner.vector_store.QueryParameters = <langchain_google_spanner.vector_store.QueryParameters object>)

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

TableColumn(name: str, type: str, is_null: bool = True)

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