Skip to main content
Open In ColabOpen on GitHub

Slack

Slack 是一个即时消息程序。

这个笔记本涵盖了如何从Slack导出生成的Zip文件中加载文档。

要获取这个Slack导出,请遵循这些说明:

🧑 指南:导入您自己的数据集

导出您的Slack数据。您可以通过转到Workspace管理页面并点击导入/导出选项({your_slack_domain}.slack.com/services/export)来完成此操作。然后,选择正确的日期范围并点击 Start export。Slack会在导出完成后通过邮件和DM通知您。

The download will produce a .zip file in your Downloads folder (or wherever your downloads can be found, depending on your OS configuration).

.zip文件的路径复制并赋值给下面的LOCAL_ZIPFILE

from langchain_community.document_loaders import SlackDirectoryLoader
# Optionally set your Slack URL. This will give you proper URLs in the docs sources.
SLACK_WORKSPACE_URL = "https://xxx.slack.com"
LOCAL_ZIPFILE = "" # Paste the local path to your Slack zip file here.

loader = SlackDirectoryLoader(LOCAL_ZIPFILE, SLACK_WORKSPACE_URL)
docs = loader.load()
docs