Telegram
This notebook shows how to use the Telegram chat loader. This class helps map exported Telegram conversations to LangChain chat messages.
The process has three steps:
- Export the chat .txt file by copying chats from the Telegram app and pasting them in a file on your local computer
- Create the
TelegramChatLoaderwith the file path pointed to the json file or directory of JSON files - Call
loader.load()(orloader.lazy_load()) to perform the conversion. Optionally usemerge_chat_runsto combine message from the same sender in sequence, and/ormap_ai_messagesto convert messages from the specified sender to the "AIMessage" class.