messages_to_dict#

langchain_core.messages.base.messages_to_dict(messages: Sequence[BaseMessage]) list[dict][source]#

Convert a sequence of Messages to a list of dictionaries.

Parameters:

messages (Sequence[BaseMessage]) – Sequence of messages (as BaseMessages) to convert.

Returns:

List of messages as dicts.

Return type:

list[dict]