Home / Class/ NonStandardContentBlock Class — langchain Architecture

NonStandardContentBlock Class — langchain Architecture

Architecture documentation for the NonStandardContentBlock class in content.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  a8da9647_3528_6cb1_33a1_dfdf2b060f80["NonStandardContentBlock"]
  c7f11daf_e104_efbe_7225_f1d6da8e8630["content.py"]
  a8da9647_3528_6cb1_33a1_dfdf2b060f80 -->|defined in| c7f11daf_e104_efbe_7225_f1d6da8e8630

Relationship Graph

Source Code

libs/core/langchain_core/messages/content.py lines 790–828

class NonStandardContentBlock(TypedDict):
    """Provider-specific content data.

    This block contains data for which there is not yet a standard type.

    The purpose of this block should be to simply hold a provider-specific payload.
    If a provider's non-standard output includes reasoning and tool calls, it should be
    the adapter's job to parse that payload and emit the corresponding standard
    `ReasoningContentBlock` and `ToolCalls`.

    Has no `extras` field, as provider-specific data should be included in the
    `value` field.

    !!! note "Factory function"

        `create_non_standard_block` may also be used as a factory to create a
        `NonStandardContentBlock`. Benefits include:

        * Automatic ID generation (when not provided)
        * Required arguments strictly validated at creation time
    """

    type: Literal["non_standard"]
    """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_'`))
    """

    value: dict[str, Any]
    """Provider-specific content data."""

    index: NotRequired[int | str]
    """Index of block in aggregate response. Used during streaming."""

Frequently Asked Questions

What is the NonStandardContentBlock class?
NonStandardContentBlock is a class in the langchain codebase, defined in libs/core/langchain_core/messages/content.py.
Where is NonStandardContentBlock defined?
NonStandardContentBlock is defined in libs/core/langchain_core/messages/content.py at line 790.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free