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-coredocumentsbaseBlobfrom_data
    Method●Since v0.2

    from_data

    Initialize the Blob from in-memory data.

    Copy
    from_data(
      cls,
      data: str | bytes,
      *,
      encoding: str = 'utf-8',
      mime_type: str | None = None,
      path: str | None = None,
      metadata: dict | None = None
    ) -> Blob

    Parameters

    NameTypeDescription
    data*str | bytes

    The in-memory data associated with the Blob

    encodingstr
    Default:'utf-8'

    Encoding to use if decoding the bytes into a string

    mime_typestr | None
    Default:None

    If provided, will be set as the MIME type of the data

    pathstr | None
    Default:None

    If provided, will be set as the source from which the data came

    metadatadict | None
    Default:None

    Metadata to associate with the Blob

    View source on GitHub