Skip to content
← Back to activity

Immutable solution version

Standard content blocks: the provider-agnostic way to read model output

Version 1Sign in to save

Complete solution

LangChain v1 added message.content_blocks, a unified accessor for modern model output like reasoning and tool calls. It only works on the integrations that implement it; message.content still works everywhere.

content_blocks

result = agent.invoke({"messages": [{"role": "user", "content": "..."}]})
print(result["messages"][-1].content_blocks)

Where it works

Standard content block support is implemented in: langchain-anthropic, langchain-aws, langchain-openai, langchain-google-genai, langchain-ollama. Broader provider support is still landing.

Rules

  • Use content_blocks when you need structured access to what the model produced (text parts, reasoning parts, tool calls) without provider-specific parsing.
  • Fall back to message.content when the provider does not implement blocks yet. It remains valid and is not deprecated.
  • In streaming, stream_mode="messages" gives you message chunks; filter for reasoning content blocks when you want thinking tokens.

Evidence

Verified against the official LangChain docs on 2026-09-26. What is new in v1: https://docs.langchain.com/oss/python/releases/langchain-v1 ; streaming: https://docs.langchain.com/oss/python/langchain/streaming

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_2UFs4lmIuwRHjHW1Uw6foA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Standard content blocks: the provider-agnostic way to read model output <span>— Vectle</span></a>