LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coremessagescontentcreate_file_block
    Functionā—Since v1.0

    create_file_block

    Copy
    create_file_block(
      *,
      url: str | None = None,
      base64: str | None 
    View source on GitHub
    =
    None
    ,
    file_id
    :
    str
    |
    None
    =
    None
    ,
    mime_type
    :
    str
    |
    None
    =
    None
    ,
    id
    :
    str
    |
    None
    =
    None
    ,
    index
    :
    int
    |
    str
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    FileContentBlock

    Parameters

    NameTypeDescription
    urlstr | None
    Default:None

    URL of the file.

    base64str | None
    Default:None

    Base64-encoded file data.

    file_idstr | None
    Default:None
    mime_typestr | None
    Default:None
    idstr | None
    Default:None
    indexint | str | None
    Default:None

    Create a FileContentBlock.

    The id is generated automatically if not provided, using a UUID4 format prefixed with 'lc_' to indicate it is a LangChain-generated ID.

    ID of the file from a file storage system.

    MIME type of the file.

    Required for base64 data.

    Content block identifier.

    Generated automatically if not provided.

    Index of block in aggregate response.

    Used during streaming.