initial commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
"""**Chat Loaders** load chat messages from common communications platforms.
|
||||
|
||||
Load chat messages from various
|
||||
communications platforms such as Facebook Messenger, Telegram, and
|
||||
WhatsApp. The loaded chat messages can be used for fine-tuning models.
|
||||
"""
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
from langchain_core.chat_loaders import BaseChatLoader
|
||||
|
||||
__all__ = ["BaseChatLoader"]
|
||||
@@ -0,0 +1,32 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain_classic._api.module_import import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.chat_loaders.facebook_messenger import (
|
||||
FolderFacebookMessengerChatLoader,
|
||||
SingleFileFacebookMessengerChatLoader,
|
||||
)
|
||||
|
||||
module_lookup = {
|
||||
"SingleFileFacebookMessengerChatLoader": (
|
||||
"langchain_community.chat_loaders.facebook_messenger"
|
||||
),
|
||||
"FolderFacebookMessengerChatLoader": (
|
||||
"langchain_community.chat_loaders.facebook_messenger"
|
||||
),
|
||||
}
|
||||
|
||||
# Temporary code for backwards compatibility for deprecated imports.
|
||||
# This will eventually be removed.
|
||||
import_lookup = create_importer(
|
||||
__package__,
|
||||
deprecated_lookups=module_lookup,
|
||||
)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
return import_lookup(name)
|
||||
|
||||
|
||||
__all__ = ["FolderFacebookMessengerChatLoader", "SingleFileFacebookMessengerChatLoader"]
|
||||
@@ -0,0 +1,23 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain_classic._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.chat_loaders.gmail import GMailLoader
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"GMailLoader": "langchain_community.chat_loaders.gmail"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"GMailLoader",
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain_classic._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.chat_loaders.imessage import IMessageChatLoader
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"IMessageChatLoader": "langchain_community.chat_loaders.imessage"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"IMessageChatLoader",
|
||||
]
|
||||
@@ -0,0 +1,30 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain_classic._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.chat_loaders.langsmith import (
|
||||
LangSmithDatasetChatLoader,
|
||||
LangSmithRunChatLoader,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"LangSmithRunChatLoader": "langchain_community.chat_loaders.langsmith",
|
||||
"LangSmithDatasetChatLoader": "langchain_community.chat_loaders.langsmith",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"LangSmithDatasetChatLoader",
|
||||
"LangSmithRunChatLoader",
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain_classic._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.chat_loaders.slack import SlackChatLoader
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"SlackChatLoader": "langchain_community.chat_loaders.slack"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"SlackChatLoader",
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain_classic._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.chat_loaders.telegram import TelegramChatLoader
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"TelegramChatLoader": "langchain_community.chat_loaders.telegram"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"TelegramChatLoader",
|
||||
]
|
||||
@@ -0,0 +1,36 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain_classic._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.chat_loaders.utils import (
|
||||
map_ai_messages,
|
||||
map_ai_messages_in_session,
|
||||
merge_chat_runs,
|
||||
merge_chat_runs_in_session,
|
||||
)
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {
|
||||
"merge_chat_runs_in_session": "langchain_community.chat_loaders.utils",
|
||||
"merge_chat_runs": "langchain_community.chat_loaders.utils",
|
||||
"map_ai_messages_in_session": "langchain_community.chat_loaders.utils",
|
||||
"map_ai_messages": "langchain_community.chat_loaders.utils",
|
||||
}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"map_ai_messages",
|
||||
"map_ai_messages_in_session",
|
||||
"merge_chat_runs",
|
||||
"merge_chat_runs_in_session",
|
||||
]
|
||||
@@ -0,0 +1,23 @@
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
from langchain_classic._api import create_importer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langchain_community.chat_loaders.whatsapp import WhatsAppChatLoader
|
||||
|
||||
# Create a way to dynamically look up deprecated imports.
|
||||
# Used to consolidate logic for raising deprecation warnings and
|
||||
# handling optional imports.
|
||||
DEPRECATED_LOOKUP = {"WhatsAppChatLoader": "langchain_community.chat_loaders.whatsapp"}
|
||||
|
||||
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||
|
||||
|
||||
def __getattr__(name: str) -> Any:
|
||||
"""Look up attributes dynamically."""
|
||||
return _import_attribute(name)
|
||||
|
||||
|
||||
__all__ = [
|
||||
"WhatsAppChatLoader",
|
||||
]
|
||||
Reference in New Issue
Block a user