langchain_core.messages.base
.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]