diff --git a/langchain-core/src/messages/utils.ts b/langchain-core/src/messages/utils.ts index ee31d8245b27..1f89248afb1a 100644 --- a/langchain-core/src/messages/utils.ts +++ b/langchain-core/src/messages/utils.ts @@ -115,7 +115,11 @@ function _constructMessageFromParams( }); } else { throw new Error( - `Unable to coerce message from array: only human, AI, or system message coercion is currently supported.\n\nReceived:${params}` + `Unable to coerce message from array: only human, AI, or system message coercion is currently supported.\n\nReceived: ${JSON.stringify( + params, + null, + 2 + )}` ); } }