Converting LangChain Messages to OpenAI and Amazon Bedrock Converse Formats (opens in new tab) 6 articles covering this post
When building AI applications with LangChain, your chat history usually lives as a list of LangChain message objects like SystemMessage, HumanMessage, AIMessage, and ToolMessage. That format is convenient inside LangChain, but you may eventually need to save the conversation history, inspect it, or send it to different providers such as OpenAI-compatible APIs or Amazon Bedrock Converse. Out Langchain conversation history will be: Converted to OpenAI chat-completions format. Converted to Amazo...
Read the original article