- Export the desired conversation thread by following the instructions here.
- Create the
SlackChatLoader
with 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_runs
to combine message from the same sender in sequence, and/ormap_ai_messages
to convert messages from the specified sender to the “AIMessage” class.
1. Create message dump
Currently (2023/08/23), this loader best supports a zip directory of files in the format generated by exporting your a direct message conversation from Slack. Follow the up-to-date instructions from slack on how to do so. We have an example in the LangChain repo.2. Create the Chat Loader
Provide the loader with the file path to the zip directory. You can optionally specify the user id that maps to an ai message as well as configure whether to merge message runs.3. Load messages
Theload()
(or lazy_load
) methods return a list of “ChatSessions” that currently just contain a list of messages per loaded conversation.