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

    Create a PlainTextContentBlock.

    Copy
    create_plaintext_block(
      text: str | None = None,
      url: str | None = 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

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

    Parameters

    NameTypeDescription
    textstr | None
    Default:None

    The plaintext content.

    urlstr | None
    Default:None

    URL of the plaintext file.

    base64str | None
    Default:None

    Base64-encoded plaintext data.

    file_idstr | None
    Default:None

    ID of the plaintext file from a file storage system.

    titlestr | None
    Default:None

    Title of the text data.

    contextstr | None
    Default:None

    Context or description of the text content.

    idstr | None
    Default:None

    Content block identifier.

    Generated automatically if not provided.

    indexint | str | None
    Default:None

    Index of block in aggregate response.

    Used during streaming.

    View source on GitHub