> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-zh.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack 集成

> 使用 LangChain Python 与 Slack 文档加载器集成。

> [Slack](https://slack.com/) 是一款即时通讯程序。

本笔记本介绍了如何从 `Slack` 导出生成的 Zip 文件中加载文档。

要获取此 `Slack` 导出文件，请按照以下说明操作：

## 🧑 导入自有数据集的说明

导出你的 Slack 数据。你可以通过进入工作区管理页面并点击导入/导出选项（\{你的 Slack 域名}.slack.com/services/export）来完成此操作。然后，选择正确的日期范围并点击 `开始导出`。当导出准备好时，Slack 会通过电子邮件和私信通知你。

下载完成后，你的下载文件夹（或根据你的操作系统配置，下载文件可能存放的位置）中会生成一个 `.zip` 文件。

复制该 `.zip` 文件的路径，并将其赋值给下面的 `LOCAL_ZIPFILE`。

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_community.document_loaders import SlackDirectoryLoader
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
# 可选设置你的 Slack URL。这将为文档来源提供正确的 URL。
SLACK_WORKSPACE_URL = "https://xxx.slack.com"
LOCAL_ZIPFILE = ""  # 在此处粘贴你的 Slack zip 文件的本地路径。

loader = SlackDirectoryLoader(LOCAL_ZIPFILE, SLACK_WORKSPACE_URL)
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
docs = loader.load()
docs
```

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\oss\python\integrations\document_loaders\slack.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
