LangChain · Function
convert_to_messages
Converts supported message-like input into a list of BaseMessage objects. It accepts either an iterable of message representations or a PromptValue.
Last updated
- Since
- v1.7
Syntax
convert_to_messages(messages: Iterable[MessageLikeRepresentation] | PromptValue) -> list[BaseMessage]In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
MessageLikeRepresentationBaseMessagePromptValuemessages_from_dictmessage_chunk_to_messageconvert_to_openai_messages