Class BigtableSaver (0.3.1)

BigtableSaver(
    instance_id: str,
    table_id: str,
    client: typing.Optional[google.cloud.bigtable.client.Client] = None,
    content_encoding: langchain_google_bigtable.loader.Encoding = Encoding.UTF8,
    content_column_family: str = "langchain",
    content_column_name: str = "content",
    metadata_mappings: typing.List[
        langchain_google_bigtable.loader.MetadataMapping
    ] = [],
    metadata_as_json_column_family: typing.Optional[str] = None,
    metadata_as_json_column_name: typing.Optional[str] = None,
    metadata_as_json_encoding: langchain_google_bigtable.loader.Encoding = Encoding.UTF8,
)

Load from the Google Cloud Platform Bigtable.

Methods

BigtableSaver

BigtableSaver(
    instance_id: str,
    table_id: str,
    client: typing.Optional[google.cloud.bigtable.client.Client] = None,
    content_encoding: langchain_google_bigtable.loader.Encoding = Encoding.UTF8,
    content_column_family: str = "langchain",
    content_column_name: str = "content",
    metadata_mappings: typing.List[
        langchain_google_bigtable.loader.MetadataMapping
    ] = [],
    metadata_as_json_column_family: typing.Optional[str] = None,
    metadata_as_json_column_name: typing.Optional[str] = None,
    metadata_as_json_encoding: langchain_google_bigtable.loader.Encoding = Encoding.UTF8,
)

Initialize Bigtable document saver.

add_documents

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

Save documents in the DocumentSaver table. Document's metadata is added to columns if found or stored in langchain_metadata JSON column.

Parameter
Name Description
docs List[langchain_core.documents.Document]

a list of documents to be saved.

delete

delete(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.

Parameter
Name Description
docs List[langchain_core.documents.Document]

a list of documents to be deleted.