Home / Class/ VideoContentBlock Class — langchain Architecture

VideoContentBlock Class — langchain Architecture

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

Entity Profile

Dependency Diagram

graph TD
  f73cf810_8750_87ce_b9aa_5f65b6b3e917["VideoContentBlock"]
  c7f11daf_e104_efbe_7225_f1d6da8e8630["content.py"]
  f73cf810_8750_87ce_b9aa_5f65b6b3e917 -->|defined in| c7f11daf_e104_efbe_7225_f1d6da8e8630

Relationship Graph

Source Code

libs/core/langchain_core/messages/content.py lines 549–597

class VideoContentBlock(TypedDict):
    """Video data.

    !!! note "Factory function"

        `create_video_block` may also be used as a factory to create a
        `VideoContentBlock`. Benefits include:

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

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

    file_id: NotRequired[str]
    """Reference to the video in an external file storage system.

    For example, OpenAI or Anthropic's Files API.
    """

    mime_type: NotRequired[str]
    """MIME type of the video.

    Required for base64 data.

    [Examples from IANA](https://www.iana.org/assignments/media-types/media-types.xhtml#video)
    """

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

    url: NotRequired[str]
    """URL of the video."""

    base64: NotRequired[str]
    """Data as a base64 string."""

    extras: NotRequired[dict[str, Any]]
    """Provider-specific metadata. This shouldn't be used for the video data itself."""

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free