langchain_community.chat_message_histories.sql.DefaultMessageConverter¶

class langchain_community.chat_message_histories.sql.DefaultMessageConverter(table_name: str)[source]¶

The default message converter for SQLChatMessageHistory.

Methods

__init__(table_name)

from_sql_model(sql_message)

Convert a SQLAlchemy model to a BaseMessage instance.

get_sql_model_class()

Get the SQLAlchemy model class.

to_sql_model(message, session_id)

Convert a BaseMessage instance to a SQLAlchemy model.

Parameters

table_name (str) –

__init__(table_name: str)[source]¶
Parameters

table_name (str) –

from_sql_model(sql_message: Any) BaseMessage[source]¶

Convert a SQLAlchemy model to a BaseMessage instance.

Parameters

sql_message (Any) –

Return type

BaseMessage

get_sql_model_class() Any[source]¶

Get the SQLAlchemy model class.

Return type

Any

to_sql_model(message: BaseMessage, session_id: str) Any[source]¶

Convert a BaseMessage instance to a SQLAlchemy model.

Parameters
  • message (BaseMessage) –

  • session_id (str) –

Return type

Any