Find answers from the community

Updated 11 months ago

Weird quirk in anthropic messages API.

At a glance

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.

Weird quirk in anthropic messages API.

Plain Text
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).
L
s
4 comments
bruh anthropic, y
Now I am back to drawing board for the react agent
You kmow I am pretty sure the old API allowed trailing white spaces.
yea thats a super strange change to make on their end
Add a reply
Sign up and join the conversation on Discord