> ## 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.

# 发布集成

**让你的集成对社区可用。**

<Warning>
  **请勿向 LangChain 或 Deep Agents 仓库提交集成 PR。**

  新的集成应作为**独立的 PyPI 包**发布在你自己的 GitHub 组织或账户下（例如 `langchain-yourservice`），而不是作为 PR 提交到 [`langchain-ai/langchain`](https://github.com/langchain-ai/langchain) 仓库。

  主仓库仅包含由 LangChain 团队维护的一小部分第一方集成（如 OpenAI、Anthropic 和 Ollama）。
</Warning>

现在你的包已经实现并测试完毕，你可以发布它并添加文档，使其能够被社区发现。

## 发布你的包

<Info>
  本指南假设你已经实现了你的包并为其编写了测试。如果还没有，请参考[实现指南](/oss/python/contributing/implement-langchain)和[测试指南](/oss/python/contributing/standard-tests-langchain)。
</Info>

出于本指南的目的，我们将使用 PyPI 作为包注册表。你也可以选择发布到其他注册表；具体说明会有所不同。

### 设置凭据

首先，确保你有一个 PyPI 账户：

<AccordionGroup>
  <Accordion title="如何创建 PyPI 令牌" icon="key">
    <Steps>
      <Step title="创建账户">
        访问 [PyPI 网站](https://pypi.org/) 并创建一个账户
      </Step>

      <Step title="验证邮箱">
        通过点击 PyPI 发送给你的邮件中的链接来验证你的邮箱地址
      </Step>

      <Step title="启用 2FA">
        进入你的账户设置，点击“生成恢复代码”以启用双因素认证。要生成 API 令牌，你**必须**启用 2FA
      </Step>

      <Step title="生成令牌">
        进入你的账户设置并[生成一个新的 API 令牌](https://pypi.org/manage/account/token/)
      </Step>
    </Steps>
  </Accordion>
</AccordionGroup>

### 构建与发布

<Card title="如何发布包" icon="upload" href="https://docs.astral.sh/uv/guides/package/" arrow>
  来自 `uv` 的有用指南，介绍如何构建包并发布到 PyPI。
</Card>

## 添加文档

要将你的包的文档添加到本网站的[集成选项卡](/oss/python/integrations/providers/overview)下，你需要创建相关的文档页面，并在 [LangChain 文档仓库](https://github.com/langchain-ai/docs) 中提交一个 PR。

### 编写文档

根据你构建的集成类型，你需要创建不同类型的文档页面。LangChain 为不同类型的集成提供了模板，帮助你快速上手。

<CardGroup>
  <Card title="聊天模型" icon="message" href="https://github.com/langchain-ai/docs/blob/main/src/oss/python/integrations/chat/TEMPLATE.mdx" arrow />

  <Card title="工具/工具包" icon="tool" href="https://github.com/langchain-ai/docs/blob/main/src/oss/python/integrations/tools/TEMPLATE.mdx" arrow />

  <Card title="中间件" icon="plug" href="https://github.com/langchain-ai/docs/blob/main/src/oss/python/integrations/middleware/TEMPLATE.mdx" arrow />

  <Card title="向量存储" icon="database" href="https://github.com/langchain-ai/docs/blob/main/src/oss/python/integrations/vectorstores/TEMPLATE.mdx" arrow />
</CardGroup>

<Tip>
  要参考现有文档，你可以查看[集成列表](/oss/python/integrations/providers/overview)并找到与你类似的集成。

  要以原始 Markdown 格式查看某个文档页面，请使用页面右上角“复制页面”旁边的下拉按钮，并选择“以 Markdown 查看”。
</Tip>

### 向文档仓库提交 PR

在个人 GitHub 账户下 Fork [LangChain 文档仓库](https://github.com/langchain-ai/docs)（不是主 `langchain` 仓库），并在本地克隆它。为你的集成创建一个新分支。复制模板并使用你喜欢的 Markdown 文本编辑器进行修改。编写文档时，请务必参考并遵循[文档指南](/oss/python/contributing/documentation)。

<Info>
  此 PR **仅用于文档**。你的集成包本身应位于你自己的 GitHub 组织或账户下的独立仓库中，并作为独立包发布到 PyPI。
</Info>

<Warning>
  在以下情况下，我们可能会拒绝 PR 或要求修改：

  * CI 检查失败
  * 存在严重的语法错误或拼写错误
  * [Mintlify 组件](/oss/python/contributing/documentation#mintlify-components)使用不正确
  * 页面缺少 [frontmatter](/oss/python/contributing/documentation#page-structure)
  * 缺少[本地化](/oss/python/contributing/documentation#localization)（如适用）
  * [代码示例](/oss/python/contributing/documentation#in-code-documentation)无法运行或存在错误
  * 未达到[质量标准](/oss/python/contributing/documentation#quality-standards)
</Warning>

请耐心等待，因为我们处理的 PR 数量很大。我们将尽快审核你的 PR 并提供反馈或合并它。**请勿反复标记维护者询问你的 PR。**

<Note>
  如果你的 PR 包含 AI 生成的内容，你必须遵循我们的[LLM 可接受使用政策](/oss/python/contributing/overview#acceptable-uses-of-llms)。
</Note>

***

## 后续步骤

**恭喜！** 你的集成现已发布并完成文档编写，可供整个 LangChain 社区使用。

<Card title="联合营销" icon="speakerphone" href="/oss/python/contributing/comarketing" arrow>
  联系 LangChain 营销团队，探索联合营销机会。
</Card>

***

<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\contributing\publish-langchain.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>
