Home / Function/ create_non_standard_block() — langchain Function Reference

create_non_standard_block() — langchain Function Reference

Architecture documentation for the create_non_standard_block() function in content.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f8abb7e3_87e9_1dc9_0b21_cc6349aa68ea["create_non_standard_block()"]
  c7f11daf_e104_efbe_7225_f1d6da8e8630["content.py"]
  f8abb7e3_87e9_1dc9_0b21_cc6349aa68ea -->|defined in| c7f11daf_e104_efbe_7225_f1d6da8e8630
  style f8abb7e3_87e9_1dc9_0b21_cc6349aa68ea fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/messages/content.py lines 1454–1488

def create_non_standard_block(
    value: dict[str, Any],
    *,
    id: str | None = None,
    index: int | str | None = None,
) -> NonStandardContentBlock:
    """Create a `NonStandardContentBlock`.

    Args:
        value: Provider-specific content data.
        id: Content block identifier.

            Generated automatically if not provided.
        index: Index of block in aggregate response.

            Used during streaming.

    Returns:
        A properly formatted `NonStandardContentBlock`.

    !!! note

        The `id` is generated automatically if not provided, using a UUID4 format
        prefixed with `'lc_'` to indicate it is a LangChain-generated ID.
    """
    block = NonStandardContentBlock(
        type="non_standard",
        value=value,
        id=ensure_id(id),
    )

    if index is not None:
        block["index"] = index

    return block

Domain

Subdomains

Frequently Asked Questions

What does create_non_standard_block() do?
create_non_standard_block() is a function in the langchain codebase, defined in libs/core/langchain_core/messages/content.py.
Where is create_non_standard_block() defined?
create_non_standard_block() is defined in libs/core/langchain_core/messages/content.py at line 1454.

Analyze Your Own Codebase

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

Try Supermodel Free