Skip to content

fix(anthropic): route HumanMessage contentBlocks through standard content formatter#10435

Open
Joaquin Hui (joaquinhuigomez) wants to merge 2 commits intolangchain-ai:mainfrom
joaquinhuigomez:fix/anthropic-human-message-standard-content-blocks
Open

fix(anthropic): route HumanMessage contentBlocks through standard content formatter#10435
Joaquin Hui (joaquinhuigomez) wants to merge 2 commits intolangchain-ai:mainfrom
joaquinhuigomez:fix/anthropic-human-message-standard-content-blocks

Conversation

@joaquinhuigomez
Copy link

@joaquinhuigomez Joaquin Hui (joaquinhuigomez) commented Mar 17, 2026

No description provided.

…tent formatter

When HumanMessage is created with contentBlocks (the standard content
block API), the content blocks were processed through _formatContentBlocks
which lacks support for text-plain blocks and rich metadata (citations,
context, title) on file blocks. This change removes the AIMessage-only
gate on the output_version v1 check so that any message created with
contentBlocks uses _formatStandardContent, which has complete support
for all standard content block types.

Fixes langchain-ai#9877
@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2026

🦋 Changeset detected

Latest commit: 7b9cdde

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/anthropic Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@joaquinhuigomez Joaquin Hui (joaquinhuigomez) force-pushed the fix/anthropic-human-message-standard-content-blocks branch from 0a3f10f to 7b9cdde Compare March 24, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants