This error occurs when message objects don’t conform to the expected format. TODO: Add JS exampleDocumentation Index
Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-openap-1765292790-ae6c60d.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Troubleshooting
To resolve this error:- Ensure proper format: All inputs to chat models must be an array of LangChain message classes or a supported message-like format
- Verify no unintended stringification or transformation occurs to your messages
- Examine the error’s stack trace and add logging statements to inspect message objects before they’re passed to the model