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

    from_path

    Load the blob from a path like object.

    Copy
    from_path(
      cls,
      path: PathLike,
      *,
      encoding: str = 'utf-8',
      mime_type: str | None = None,
      guess_type: bool = True,
      metadata: dict | None = None
    ) -> Blob

    Parameters

    NameTypeDescription
    path*PathLike

    Path-like object to file to be read

    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

    guess_typebool
    Default:True

    If True, the MIME type will be guessed from the file extension, if a MIME type was not provided

    metadatadict | None
    Default:None

    Metadata to associate with the Blob

    View source on GitHub