mirror of https://github.com/hwchase17/langchain
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>pull/20955/head
parent
d4befd0cfb
commit
893a924b90
@ -1,16 +1,3 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Iterator, List
|
||||
from langchain_core.chat_loaders import BaseChatLoader
|
||||
|
||||
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())
|
||||
__all__ = ["BaseChatLoader"]
|
||||
|
@ -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())
|
@ -1,3 +1,3 @@
|
||||
from langchain_community.agent_toolkits.base import BaseToolkit
|
||||
from langchain_core.tools import BaseToolkit
|
||||
|
||||
__all__ = ["BaseToolkit"]
|
||||
|
@ -1,3 +1,3 @@
|
||||
from langchain_community.chat_loaders.base import BaseChatLoader
|
||||
from langchain_core.chat_loaders import BaseChatLoader
|
||||
|
||||
__all__ = ["BaseChatLoader"]
|
||||
|
Loading…
Reference in New Issue