Toggle Menu
Prev Up Next

# `langchain_community.adapters.openai`.convert_openai_messages

langchain_community.adapters.openai.convert_openai_messages(messages: Sequence[Dict[str, Any]]) → List[BaseMessage]

  Convert dictionaries representing OpenAI messages to LangChain format.

  Parameters

    messages (Sequence[Dict[str, Any]]) – List of dictionaries representing OpenAI messages

  Returns

    List of LangChain BaseMessage objects.

  Return type

    List[BaseMessage]