Home / File/ chat_loaders.py — langchain Source File

chat_loaders.py — langchain Source File

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

Entity Profile

Dependency Diagram

graph LR
  d81392de_b10f_bf02_811b_cb1cf9d601c6["chat_loaders.py"]
  cccbe73e_4644_7211_4d55_e8fb133a8014["abc"]
  d81392de_b10f_bf02_811b_cb1cf9d601c6 --> cccbe73e_4644_7211_4d55_e8fb133a8014
  cfe2bde5_180e_e3b0_df2b_55b3ebaca8e7["collections.abc"]
  d81392de_b10f_bf02_811b_cb1cf9d601c6 --> cfe2bde5_180e_e3b0_df2b_55b3ebaca8e7
  566c641d_032b_1d09_1c9b_542340e26e10["langchain_core.chat_sessions"]
  d81392de_b10f_bf02_811b_cb1cf9d601c6 --> 566c641d_032b_1d09_1c9b_542340e26e10
  style d81392de_b10f_bf02_811b_cb1cf9d601c6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Chat loaders."""

from abc import ABC, abstractmethod
from collections.abc import Iterator

from langchain_core.chat_sessions import ChatSession


class BaseChatLoader(ABC):
    """Base class for chat loaders."""

    @abstractmethod
    def lazy_load(self) -> Iterator[ChatSession]:
        """Lazy load the chat sessions.

        Returns:
            An iterator of chat sessions.
        """

    def load(self) -> list[ChatSession]:
        """Eagerly load the chat sessions into memory.

        Returns:
            A list of chat sessions.
        """
        return list(self.lazy_load())

Subdomains

Classes

Dependencies

  • abc
  • collections.abc
  • langchain_core.chat_sessions

Frequently Asked Questions

What does chat_loaders.py do?
chat_loaders.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, MessageSchema subdomain.
What does chat_loaders.py depend on?
chat_loaders.py imports 3 module(s): abc, collections.abc, langchain_core.chat_sessions.
Where is chat_loaders.py in the architecture?
chat_loaders.py is located at libs/core/langchain_core/chat_loaders.py (domain: CoreAbstractions, subdomain: MessageSchema, directory: libs/core/langchain_core).

Analyze Your Own Codebase

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

Try Supermodel Free