convert_to_messages#

langchain_core.messages.utils.convert_to_messages(messages: Iterable[MessageLikeRepresentation] | PromptValue) list[BaseMessage][source]#

Convert a sequence of messages to a list of messages.

Parameters:

messages (Union[Iterable[MessageLikeRepresentation], PromptValue]) – Sequence of messages to convert.

Returns:

list of messages (BaseMessages).

Return type:

list[BaseMessage]