Source code for langchain_core.chat_loaders

from abc import ABC, abstractmethod
from typing import Iterator, List

from langchain_core.chat_sessions import ChatSession


[docs]class BaseChatLoader(ABC): """用于聊天加载器的基类。"""
[docs] @abstractmethod def lazy_load(self) -> Iterator[ChatSession]: """延迟加载聊天会话。"""
[docs] def load(self) -> List[ChatSession]: """将聊天会话急切加载到内存中。""" return list(self.lazy_load())