mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-11 07:50:47 +00:00
core[minor], community[patch], langchain[patch]: move BaseChatLoader to core (#19607)
Thank you for contributing to LangChain! - [ ] **PR title**: "core: move BaseChatLoader and BaseToolkit from community" - [ ] **PR message**: move BaseChatLoader and BaseToolkit --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
This commit is contained in:
16
libs/core/langchain_core/chat_loaders.py
Normal file
16
libs/core/langchain_core/chat_loaders.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Iterator, List
|
||||
|
||||
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."""
|
||||
|
||||
def load(self) -> List[ChatSession]:
|
||||
"""Eagerly load the chat sessions into memory."""
|
||||
return list(self.lazy_load())
|
Reference in New Issue
Block a user