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_plaintext_block
    Function●Since v1.0

    create_plaintext_block

    Copy
    create_plaintext_block(
      text: str | None = None,
      url: str | None = 
    View source on GitHub
    None
    ,
    base64
    :
    str
    |
    None
    =
    None
    ,
    file_id
    :
    str
    |
    None
    =
    None
    ,
    title
    :
    str
    |
    None
    =
    None
    ,
    context
    :
    str
    |
    None
    =
    None
    ,
    id
    :
    str
    |
    None
    =
    None
    ,
    index
    :
    int
    |
    str
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    PlainTextContentBlock

    Parameters

    NameTypeDescription
    textstr | None
    Default:None

    The plaintext content.

    urlstr | None
    Default:None

    URL of the plaintext file.

    base64str | None
    Default:None
    file_idstr | None
    Default:None
    titlestr | None
    Default:None
    contextstr | None
    Default:None
    idstr | None
    Default:None
    indexint | str | None
    Default:None

    Create a PlainTextContentBlock.

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

    Base64-encoded plaintext data.

    ID of the plaintext file from a file storage system.

    Title of the text data.

    Context or description of the text content.

    Content block identifier.

    Generated automatically if not provided.

    Index of block in aggregate response.

    Used during streaming.