An error occurred (ValidationException) when calling the Converse operation: The content field in the Message object at messag es.5 is empty. Add a ContentBlock object to the content field and try again. #5367
Unanswered
parth-patel-flentas
asked this question in
Q&A
Replies: 2 comments
-
I am hitting the same issue with LLama 3 on Bedrock. |
Beta Was this translation helpful? Give feedback.
0 replies
-
with Do we have an explanation on this behaviour and how to mitigate it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
❗️ValidationException: The content field in the Message object is empty
💥 Error
I'm encountering the following error when using
ChatBedrockConverse
with LangGraph and AWS Bedrock:🧩 Context
I'm building a multi-agent LangGraph app using
ChatBedrockConverse
(claude-3-sonnet
) with a supervisor and multiple domain agents.Before invoking the graph, I sanitize the conversation history using this logic:
Despite cleaning messages before calling
.invoke()
, I'm still hitting the error.📌 Suspected Cause
The error seems to happen after tool_calls return and a message is added back to the graph with an empty
content
field.Examples:
AIMessage
withtool_calls
but nocontent
content=[]
orcontent=""
"Transferring to supervisor"
with no real content🧪 Steps to Reproduce
ChatBedrockConverse
and multiple agents.invoke()
when message history includes an empty message🧠 What I’ve Tried
"Transferring to supervisor"
BaseMessage
objects have validcontent
❓Questions
converse
?ChatBedrockConverse
require a specificcontent
format when using tool calls?content=[]
to[{"type": "text", "text": "[placeholder]"}]
?📎 Dependencies
langgraph
: latest (0.0.28+)langchain-aws
: latestaws-sdk
: properly configured for Bedrockanthropic.claude-3-sonnet-20250219-v1:0
via BedrockAny guidance on how to sanitize or transform messages for Bedrock's
converse()
would be appreciated!Thanks 🙏
Beta Was this translation helpful? Give feedback.
All reactions