Package Methods (0.2.2)

Summary of entries of Methods for langchain-google-alloydb-pg.

langchain_google_alloydb_pg.alloydb_chat_message_history._aget_messages

_aget_messages(
    engine: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine,
    session_id: str,
    table_name: str,
) -> typing.List[langchain_core.messages.base.BaseMessage]

langchain_google_alloydb_pg.alloydb_engine._get_iam_principal_email

_get_iam_principal_email(credentials: google.auth.credentials.Credentials) -> str

Get email address associated with current authenticated IAM principal.

See more: langchain_google_alloydb_pg.alloydb_engine._get_iam_principal_email

langchain_google_alloydb_pg.alloydb_vectorstore.cosine_similarity

cosine_similarity(
    X: typing.Union[
        typing.List[typing.List[float]], typing.List[numpy.ndarray], numpy.ndarray
    ],
    Y: typing.Union[
        typing.List[typing.List[float]], typing.List[numpy.ndarray], numpy.ndarray
    ],
) -> numpy.ndarray

Row-wise cosine similarity between two equal-width matrices.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.cosine_similarity

langchain_google_alloydb_pg.alloydb_vectorstore.maximal_marginal_relevance

maximal_marginal_relevance(
    query_embedding: numpy.ndarray,
    embedding_list: list,
    lambda_mult: float = 0.5,
    k: int = 4,
) -> typing.List[int]

langchain_google_alloydb_pg.alloydb_chat_message_history.AlloyDBChatMessageHistory.aadd_message

aadd_message(message: langchain_core.messages.base.BaseMessage) -> None

langchain_google_alloydb_pg.alloydb_chat_message_history.AlloyDBChatMessageHistory.aadd_messages

aadd_messages(
    messages: typing.Sequence[langchain_core.messages.base.BaseMessage],
) -> None

langchain_google_alloydb_pg.alloydb_chat_message_history.AlloyDBChatMessageHistory.aclear

aclear() -> None

langchain_google_alloydb_pg.alloydb_chat_message_history.AlloyDBChatMessageHistory.add_message

add_message(message: langchain_core.messages.base.BaseMessage) -> None

langchain_google_alloydb_pg.alloydb_chat_message_history.AlloyDBChatMessageHistory.add_messages

add_messages(
    messages: typing.Sequence[langchain_core.messages.base.BaseMessage],
) -> None

langchain_google_alloydb_pg.alloydb_chat_message_history.AlloyDBChatMessageHistory.clear

clear() -> None

langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine._aexecute

_aexecute(query: str, params: typing.Optional[dict] = None)

langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine._aexecute_outside_tx

_aexecute_outside_tx(query: str)

langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine._aload_table_schema

_aload_table_schema(table_name: str) -> sqlalchemy.sql.schema.Table

Load table schema from existing table in PgSQL database.

See more: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine._aload_table_schema

langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine.ainit_document_table

ainit_document_table(
    table_name: str,
    content_column: str = "page_content",
    metadata_columns: typing.List[
        langchain_google_alloydb_pg.alloydb_engine.Column
    ] = [],
    metadata_json_column: str = "langchain_metadata",
    store_metadata: bool = True,
) -> None

Create a table for saving of langchain documents.

See more: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine.ainit_document_table

langchain_google_alloydb_pg.alloydb_loader.AlloyDBDocumentSaver.aadd_documents

aadd_documents(docs: typing.List[langchain_core.documents.base.Document]) -> None

Save documents in the DocumentSaver table.

See more: langchain_google_alloydb_pg.alloydb_loader.AlloyDBDocumentSaver.aadd_documents

langchain_google_alloydb_pg.alloydb_loader.AlloyDBDocumentSaver.adelete

adelete(docs: typing.List[langchain_core.documents.base.Document]) -> None

Delete all instances of a document from the DocumentSaver table by matching the entire Document object.

See more: langchain_google_alloydb_pg.alloydb_loader.AlloyDBDocumentSaver.adelete

langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.alazy_load

alazy_load() -> typing.AsyncIterator[langchain_core.documents.base.Document]

Load AlloyDB data into Document objects lazily.

See more: langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.alazy_load

langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.aload

aload() -> typing.List[langchain_core.documents.base.Document]

Load Alloydb data into Document objects.

See more: langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.aload

langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.create

create(
    engine: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine,
    query: typing.Optional[str] = None,
    table_name: typing.Optional[str] = None,
    content_columns: typing.Optional[typing.List[str]] = None,
    metadata_columns: typing.Optional[typing.List[str]] = None,
    metadata_json_column: typing.Optional[str] = None,
    format: typing.Optional[str] = None,
    formatter: typing.Optional[typing.Callable] = None,
)

Constructor for AlloyDBLoader .

See more: langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.create

langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.lazy_load

lazy_load() -> typing.Iterator[langchain_core.documents.base.Document]

Load AlloyDB data into Document objects lazily.

See more: langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.lazy_load

langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.load

load() -> typing.List[langchain_core.documents.base.Document]

Load Alloydb data into Document objects.

See more: langchain_google_alloydb_pg.alloydb_loader.AlloyDBLoader.load

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.aadd_documents

aadd_documents(
    documents: typing.List[langchain_core.documents.base.Document],
    ids: typing.Optional[typing.List[str]] = None,
    **kwargs: typing.Any
) -> typing.List[str]

Run more documents through the embeddings and add to the vectorstore.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.aadd_documents

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.aadd_texts

aadd_texts(
    texts: typing.Iterable[str],
    metadatas: typing.Optional[typing.List[dict]] = None,
    ids: typing.Optional[typing.List[str]] = None,
    **kwargs: typing.Any
) -> typing.List[str]

Run more texts through the embeddings and add to the vectorstore.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.aadd_texts

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.add_documents

add_documents(
    documents: typing.List[langchain_core.documents.base.Document],
    ids: typing.Optional[typing.List[str]] = None,
    **kwargs: typing.Any
) -> typing.List[str]

Run more documents through the embeddings and add to the vectorstore.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.add_documents

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.add_texts

add_texts(
    texts: typing.Iterable[str],
    metadatas: typing.Optional[typing.List[dict]] = None,
    ids: typing.Optional[typing.List[str]] = None,
    **kwargs: typing.Any
) -> typing.List[str]

Run more texts through the embeddings and add to the vectorstore.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.add_texts

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.adelete

adelete(
    ids: typing.Optional[typing.List[str]] = None, **kwargs: typing.Any
) -> typing.Optional[bool]

Delete by vector ID or other criteria.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.adelete

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.afrom_documents

afrom_documents(
    documents: typing.List[langchain_core.documents.base.Document],
    embedding: langchain_core.embeddings.embeddings.Embeddings,
    engine: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine,
    table_name: str,
    ids: typing.Optional[typing.List[str]] = None,
    content_column: str = "content",
    embedding_column: str = "embedding",
    metadata_columns: typing.List[str] = [],
    ignore_metadata_columns: typing.Optional[typing.List[str]] = None,
    id_column: str = "langchain_id",
    metadata_json_column: str = "langchain_metadata",
    **kwargs: typing.Any
) -> langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore

Return VectorStore initialized from documents and embeddings.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.afrom_documents

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.afrom_texts

afrom_texts(
    texts: typing.List[str],
    embedding: langchain_core.embeddings.embeddings.Embeddings,
    engine: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine,
    table_name: str,
    metadatas: typing.Optional[typing.List[dict]] = None,
    ids: typing.Optional[typing.List[str]] = None,
    content_column: str = "content",
    embedding_column: str = "embedding",
    metadata_columns: typing.List[str] = [],
    ignore_metadata_columns: typing.Optional[typing.List[str]] = None,
    id_column: str = "langchain_id",
    metadata_json_column: str = "langchain_metadata",
    **kwargs: typing.Any
) -> langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore

Return VectorStore initialized from texts and embeddings.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.afrom_texts

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.amax_marginal_relevance_search

amax_marginal_relevance_search(
    query: str,
    k: typing.Optional[int] = None,
    fetch_k: typing.Optional[int] = None,
    lambda_mult: typing.Optional[float] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]

Return docs selected using the maximal marginal relevance.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.amax_marginal_relevance_search

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.amax_marginal_relevance_search_by_vector

amax_marginal_relevance_search_by_vector(
    embedding: typing.List[float],
    k: typing.Optional[int] = None,
    fetch_k: typing.Optional[int] = None,
    lambda_mult: typing.Optional[float] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.asimilarity_search

asimilarity_search(
    query: str,
    k: typing.Optional[int] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.asimilarity_search_by_vector

asimilarity_search_by_vector(
    embedding: typing.List[float],
    k: typing.Optional[int] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.asimilarity_search_with_score

asimilarity_search_with_score(
    query: str,
    k: typing.Optional[int] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[typing.Tuple[langchain_core.documents.base.Document, float]]

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.create

create(
    engine: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine,
    embedding_service: langchain_core.embeddings.embeddings.Embeddings,
    table_name: str,
    content_column: str = "content",
    embedding_column: str = "embedding",
    metadata_columns: typing.List[str] = [],
    ignore_metadata_columns: typing.Optional[typing.List[str]] = None,
    id_column: str = "langchain_id",
    metadata_json_column: typing.Optional[str] = "langchain_metadata",
    distance_strategy: langchain_google_alloydb_pg.indexes.DistanceStrategy = DistanceStrategy.COSINE_DISTANCE,
    k: int = 4,
    fetch_k: int = 20,
    lambda_mult: float = 0.5,
    index_query_options: typing.Optional[
        langchain_google_alloydb_pg.indexes.QueryOptions
    ] = None,
)

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.delete

delete(
    ids: typing.Optional[typing.List[str]] = None, **kwargs: typing.Any
) -> typing.Optional[bool]

Delete by vector ID or other criteria.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.delete

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.from_documents

from_documents(
    documents: typing.List[langchain_core.documents.base.Document],
    embedding: langchain_core.embeddings.embeddings.Embeddings,
    engine: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine,
    table_name: str,
    ids: typing.Optional[typing.List[str]] = None,
    content_column: str = "content",
    embedding_column: str = "embedding",
    metadata_columns: typing.List[str] = [],
    ignore_metadata_columns: typing.Optional[typing.List[str]] = None,
    id_column: str = "langchain_id",
    metadata_json_column: str = "langchain_metadata",
    **kwargs: typing.Any
) -> langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore

Return VectorStore initialized from documents and embeddings.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.from_documents

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.from_texts

from_texts(
    texts: typing.List[str],
    embedding: langchain_core.embeddings.embeddings.Embeddings,
    engine: langchain_google_alloydb_pg.alloydb_engine.AlloyDBEngine,
    table_name: str,
    metadatas: typing.Optional[typing.List[dict]] = None,
    ids: typing.Optional[typing.List[str]] = None,
    content_column: str = "content",
    embedding_column: str = "embedding",
    metadata_columns: typing.List[str] = [],
    ignore_metadata_columns: typing.Optional[typing.List[str]] = None,
    id_column: str = "langchain_id",
    metadata_json_column: str = "langchain_metadata",
    **kwargs: typing.Any
)

Return VectorStore initialized from texts and embeddings.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.from_texts

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.max_marginal_relevance_search

max_marginal_relevance_search(
    query: str,
    k: typing.Optional[int] = None,
    fetch_k: typing.Optional[int] = None,
    lambda_mult: typing.Optional[float] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]

Return docs selected using the maximal marginal relevance.

See more: langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.max_marginal_relevance_search

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.max_marginal_relevance_search_by_vector

max_marginal_relevance_search_by_vector(
    embedding: typing.List[float],
    k: typing.Optional[int] = None,
    fetch_k: typing.Optional[int] = None,
    lambda_mult: typing.Optional[float] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.similarity_search

similarity_search(
    query: str,
    k: typing.Optional[int] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.similarity_search_by_vector

similarity_search_by_vector(
    embedding: typing.List[float],
    k: typing.Optional[int] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[langchain_core.documents.base.Document]

langchain_google_alloydb_pg.alloydb_vectorstore.AlloyDBVectorStore.similarity_search_with_score

similarity_search_with_score(
    query: str,
    k: typing.Optional[int] = None,
    filter: typing.Optional[str] = None,
    **kwargs: typing.Any
) -> typing.List[typing.Tuple[langchain_core.documents.base.Document, float]]

langchain_google_alloydb_pg.indexes.DistanceStrategy._generate_next_value_

_generate_next_value_(start, count, last_values)

Generate the next value when not given.

See more: langchain_google_alloydb_pg.indexes.DistanceStrategy.generate_next_value