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]