The post describes a quirk in the Anthropic messages API, where the final assistant content cannot end with trailing whitespace. This applies to all the message blocks for the last assistant prompt, including prefilled content. The community members express confusion and frustration about this change, noting that the old API allowed trailing white spaces. One community member mentions having to go back to the drawing board for a React agent due to this issue.
ValidationException: An error occurred (ValidationException) when calling the InvokeModel operation: messages: final assistant content cannot end with trailing whitespace
This applies to all the message blocks for last assistant prompt viz. prefilled (assuming we are passing array as content).