0.16.0 (latest) 0.15.0 0.14.1 0.13.0 0.12.1 0.11.1 0.10.0 0.9.0 0.8.0 0.7.0 0.6.1 0.5.0 0.4.1 Summary of entries of Methods for langchain-google-cloud-sql-pg.

### langchain_google_cloud_sql_pg.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_cloud_sql_pg.engine._get_iam_principal_email](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine#langchain_google_cloud_sql_pg_engine__get_iam_principal_email)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory

    PostgresChatMessageHistory(
        key: object,
        engine: langchain_google_cloud_sql_pg.engine.PostgresEngine,
        history: langchain_google_cloud_sql_pg.async_chat_message_history.AsyncPostgresChatMessageHistory,
    )

PostgresChatMessageHistory constructor.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_PostgresChatMessageHistory)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.aadd_message

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

Append the message to the record in PostgreSQL.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.aadd_message](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_aadd_message)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.aadd_messages

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

Append a list of messages to the record in PostgreSQL.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.aadd_messages](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_aadd_messages)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.aclear

    aclear() -> None

Clear session memory from PostgreSQL.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.aclear](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_aclear)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.add_message

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

Append the message to the record in PostgreSQL.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.add_message](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_add_message)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.add_messages

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

Append a list of messages to the record in PostgreSQL.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.add_messages](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_add_messages)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.clear

    clear() -> None

Clear session memory from PostgreSQL.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.clear](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_clear)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.create

    create(
        engine: langchain_google_cloud_sql_pg.engine.PostgresEngine,
        session_id: str,
        table_name: str,
        schema_name: str = "public",
    ) -> langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory

Create a new PostgresChatMessageHistory instance.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.create](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_create)

### langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.create_sync

    create_sync(
        engine: langchain_google_cloud_sql_pg.engine.PostgresEngine,
        session_id: str,
        table_name: str,
        schema_name: str = "public",
    ) -> langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory

Create a new PostgresChatMessageHistory instance.

See more: [langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory.create_sync](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory#langchain_google_cloud_sql_pg_chat_message_history_PostgresChatMessageHistory_create_sync)

### langchain_google_cloud_sql_pg.engine.PostgresEngine

    PostgresEngine(
        key: object,
        pool: sqlalchemy.ext.asyncio.engine.AsyncEngine,
        loop: typing.Optional[asyncio.events.AbstractEventLoop],
        thread: typing.Optional[threading.Thread],
    )

PGEngine constructor.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_PostgresEngine)

### langchain_google_cloud_sql_pg.engine.PostgresEngine._ainit_chat_history_table

    _ainit_chat_history_table(table_name: str, schema_name: str = "public") -> None

Create a Cloud SQL table to store chat history.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine._ainit_chat_history_table](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine__ainit_chat_history_table)

### langchain_google_cloud_sql_pg.engine.PostgresEngine._ainit_checkpoint_table

    _ainit_checkpoint_table(
        table_name: str = "checkpoints", schema_name: str = "public"
    ) -> None

Create PgSQL tables to save checkpoints.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine._ainit_checkpoint_table](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine__ainit_checkpoint_table)

### langchain_google_cloud_sql_pg.engine.PostgresEngine._aload_table_schema

    _aload_table_schema(
        table_name: str, schema_name: str = "public"
    ) -> sqlalchemy.sql.schema.Table

Load table schema from existing table in PgSQL database.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine._aload_table_schema](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine__aload_table_schema)

### langchain_google_cloud_sql_pg.engine.PostgresEngine._create

    _create(
        project_id: str,
        region: str,
        instance: str,
        database: str,
        ip_type: typing.Union[str, google.cloud.sql.connector.enums.IPTypes],
        user: typing.Optional[str] = None,
        password: typing.Optional[str] = None,
        loop: typing.Optional[asyncio.events.AbstractEventLoop] = None,
        thread: typing.Optional[threading.Thread] = None,
        quota_project: typing.Optional[str] = None,
        iam_account_email: typing.Optional[str] = None,
        engine_args: typing.Mapping = {},
    ) -> langchain_google_cloud_sql_pg.engine.PostgresEngine

Create a PostgresEngine instance.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine._create](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine__create)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.afrom_instance

    afrom_instance(
        project_id: str,
        region: str,
        instance: str,
        database: str,
        user: typing.Optional[str] = None,
        password: typing.Optional[str] = None,
        ip_type: typing.Union[
            str, google.cloud.sql.connector.enums.IPTypes
        ] = IPTypes.PUBLIC,
        quota_project: typing.Optional[str] = None,
        iam_account_email: typing.Optional[str] = None,
        engine_args: typing.Mapping = {},
    ) -> langchain_google_cloud_sql_pg.engine.PostgresEngine

Create a PostgresEngine from a Postgres instance.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine.afrom_instance](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_afrom_instance)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.ainit_chat_history_table

    ainit_chat_history_table(table_name: str, schema_name: str = "public") -> None

Create a Cloud SQL table to store chat history.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine.ainit_chat_history_table](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_ainit_chat_history_table)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.ainit_checkpoint_table

    ainit_checkpoint_table(
        table_name: str = "checkpoints", schema_name: str = "public"
    ) -> None

Create an PgSQL table to save checkpoint messages.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine.ainit_checkpoint_table](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_ainit_checkpoint_table)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.ainit_document_table

    ainit_document_table(
        table_name: str,
        schema_name: str = "public",
        content_column: str = "page_content",
        metadata_columns: list[langchain_postgres.v2.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_cloud_sql_pg.engine.PostgresEngine.ainit_document_table](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_ainit_document_table)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.from_connection_string

    from_connection_string(
        url: str | sqlalchemy.engine.url.URL, **kwargs: typing.Any
    ) -> langchain_google_cloud_sql_pg.engine.PostgresEngine

Create an PostgresEngine instance from arguments.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine.from_connection_string](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_from_connection_string)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.from_engine_args

    from_engine_args(
        url: str | sqlalchemy.engine.url.URL, **kwargs: typing.Any
    ) -> langchain_google_cloud_sql_pg.engine.PostgresEngine

Create an PostgresEngine instance from arguments.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine.from_engine_args](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_from_engine_args)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.from_instance

    from_instance(
        project_id: str,
        region: str,
        instance: str,
        database: str,
        user: typing.Optional[str] = None,
        password: typing.Optional[str] = None,
        ip_type: typing.Union[
            str, google.cloud.sql.connector.enums.IPTypes
        ] = IPTypes.PUBLIC,
        quota_project: typing.Optional[str] = None,
        iam_account_email: typing.Optional[str] = None,
        engine_args: typing.Mapping = {},
    ) -> langchain_google_cloud_sql_pg.engine.PostgresEngine

Create a PostgresEngine from a Postgres instance.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine.from_instance](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_from_instance)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.init_chat_history_table

    init_chat_history_table(table_name: str, schema_name: str = "public") -> None

Create a Cloud SQL table to store chat history.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine.init_chat_history_table](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_init_chat_history_table)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.init_checkpoint_table

    init_checkpoint_table(
        table_name: str = "checkpoints", schema_name: str = "public"
    ) -> None

Create Cloud SQL tables to store checkpoints.

See more: [langchain_google_cloud_sql_pg.engine.PostgresEngine.init_checkpoint_table](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_init_checkpoint_table)

### langchain_google_cloud_sql_pg.engine.PostgresEngine.init_document_table

    init_document_table(
        table_name: str,
        schema_name: str = "public",
        content_column: str = "page_content",
        metadata_columns: list[langchain_postgres.v2.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_cloud_sql_pg.engine.PostgresEngine.init_document_table](https://cloud.google.com/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.engine.PostgresEngine#langchain_google_cloud_sql_pg_engine_PostgresEngine_init_document_table)