Home / File/ blob_loaders.py — langchain Source File

blob_loaders.py — langchain Source File

Architecture documentation for blob_loaders.py, a python file in the langchain codebase. 4 imports, 0 dependents.

File python DocumentProcessing DataLoaders 4 imports 1 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  880470d7_0852_d891_c935_f3405331b738["blob_loaders.py"]
  cccbe73e_4644_7211_4d55_e8fb133a8014["abc"]
  880470d7_0852_d891_c935_f3405331b738 --> cccbe73e_4644_7211_4d55_e8fb133a8014
  8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3["typing"]
  880470d7_0852_d891_c935_f3405331b738 --> 8e2034b7_ceb8_963f_29fc_2ea6b50ef9b3
  e46f4a9d_5482_b595_2107_c5825c92261e["langchain_core.documents.base"]
  880470d7_0852_d891_c935_f3405331b738 --> e46f4a9d_5482_b595_2107_c5825c92261e
  cfe2bde5_180e_e3b0_df2b_55b3ebaca8e7["collections.abc"]
  880470d7_0852_d891_c935_f3405331b738 --> cfe2bde5_180e_e3b0_df2b_55b3ebaca8e7
  style 880470d7_0852_d891_c935_f3405331b738 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Schema for Blobs and Blob Loaders.

The goal is to facilitate decoupling of content loading from content parsing code. In
addition, content loading code should provide a lazy loading interface by default.
"""

from __future__ import annotations

from abc import ABC, abstractmethod
from typing import TYPE_CHECKING

# Re-export Blob and PathLike for backwards compatibility
from langchain_core.documents.base import Blob, PathLike

if TYPE_CHECKING:
    from collections.abc import Iterator


class BlobLoader(ABC):
    """Abstract interface for blob loaders implementation.

    Implementer should be able to load raw content from a storage system according to
    some criteria and return the raw content lazily as a stream of blobs.
    """

    @abstractmethod
    def yield_blobs(
        self,
    ) -> Iterator[Blob]:
        """A lazy loader for raw data represented by LangChain's `Blob` object.

        Yields:
            `Blob` objects.
        """


# Re-export Blob and Pathlike for backwards compatibility
__all__ = ["Blob", "BlobLoader", "PathLike"]

Subdomains

Functions

Classes

Dependencies

  • abc
  • collections.abc
  • langchain_core.documents.base
  • typing

Frequently Asked Questions

What does blob_loaders.py do?
blob_loaders.py is a source file in the langchain codebase, written in python. It belongs to the DocumentProcessing domain, DataLoaders subdomain.
What functions are defined in blob_loaders.py?
blob_loaders.py defines 1 function(s): collections.
What does blob_loaders.py depend on?
blob_loaders.py imports 4 module(s): abc, collections.abc, langchain_core.documents.base, typing.
Where is blob_loaders.py in the architecture?
blob_loaders.py is located at libs/core/langchain_core/document_loaders/blob_loaders.py (domain: DocumentProcessing, subdomain: DataLoaders, directory: libs/core/langchain_core/document_loaders).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free