ReasoningContentBlock Class — langchain Architecture
Architecture documentation for the ReasoningContentBlock class in content.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 62d2063c_489e_57e3_2e65_fcb7a8299245["ReasoningContentBlock"] c7f11daf_e104_efbe_7225_f1d6da8e8630["content.py"] 62d2063c_489e_57e3_2e65_fcb7a8299245 -->|defined in| c7f11daf_e104_efbe_7225_f1d6da8e8630
Relationship Graph
Source Code
libs/core/langchain_core/messages/content.py lines 456–492
class ReasoningContentBlock(TypedDict):
"""Reasoning output from a LLM.
!!! note "Factory function"
`create_reasoning_block` may also be used as a factory to create a
`ReasoningContentBlock`. Benefits include:
* Automatic ID generation (when not provided)
* Required arguments strictly validated at creation time
"""
type: Literal["reasoning"]
"""Type of the content block. Used for discrimination."""
id: NotRequired[str]
"""Unique identifier for this content block.
Either:
- Generated by the provider
- Generated by LangChain upon creation (`UUID4` prefixed with `'lc_'`))
"""
reasoning: NotRequired[str]
"""Reasoning text.
Either the thought summary or the raw reasoning text itself.
Often parsed from `<think>` tags in the model's response.
"""
index: NotRequired[int | str]
"""Index of block in aggregate response. Used during streaming."""
extras: NotRequired[dict[str, Any]]
"""Provider-specific metadata."""
Defined In
Source
Frequently Asked Questions
What is the ReasoningContentBlock class?
ReasoningContentBlock is a class in the langchain codebase, defined in libs/core/langchain_core/messages/content.py.
Where is ReasoningContentBlock defined?
ReasoningContentBlock is defined in libs/core/langchain_core/messages/content.py at line 456.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free