chat_loaders#

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.

Class hierarchy:

BaseChatLoader --> <name>ChatLoader  # Examples: WhatsAppChatLoader, IMessageChatLoader

Main helpers:

ChatSession

Classes

chat_loaders.facebook_messenger.FolderFacebookMessengerChatLoader(path)

Load Facebook Messenger chat data from a folder.

chat_loaders.facebook_messenger.SingleFileFacebookMessengerChatLoader(path)

Load Facebook Messenger chat data from a single file.

chat_loaders.imessage.IMessageChatLoader([path])

Load chat sessions from the iMessage chat.db SQLite file.

chat_loaders.langsmith.LangSmithDatasetChatLoader(*, ...)

Load chat sessions from a LangSmith dataset with the "chat" data type.

chat_loaders.langsmith.LangSmithRunChatLoader(runs)

Load chat sessions from a list of LangSmith "llm" runs.

chat_loaders.slack.SlackChatLoader(path)

Load Slack conversations from a dump zip file.

chat_loaders.telegram.TelegramChatLoader(path)

Load telegram conversations to LangChain chat messages.

chat_loaders.whatsapp.WhatsAppChatLoader(path)

Load WhatsApp conversations from a dump zip file or directory.

Functions

chat_loaders.imessage.nanoseconds_from_2001_to_datetime(...)

Convert nanoseconds since 2001 to a datetime object.

chat_loaders.utils.map_ai_messages(...)

Convert messages from the specified 'sender' to AI messages.

chat_loaders.utils.map_ai_messages_in_session(...)

Convert messages from the specified 'sender' to AI messages.

chat_loaders.utils.merge_chat_runs(chat_sessions)

Merge chat runs together.

chat_loaders.utils.merge_chat_runs_in_session(...)

Merge chat runs together in a chat session.

Deprecated classes

chat_loaders.gmail.GMailLoader(creds[, n, ...])

Deprecated since version 0.0.32: Use langchain_google_community.GMailLoader instead.