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

# 选择插件类型

> 一份简明的决策指南，帮助你在工具、模型、Agent 策略、扩展、数据源和触发器插件之间做出选择

Dify 支持多种插件类型，每种类型针对平台内不同的扩展点。根据代码的调用方式，选择匹配的类型。

## 快速决策

| 你想要…… | 构建一个…… |
| :- | :- |
| 为 Agent 和工作流添加可调用的动作（搜索、发送邮件、转换数据等） | [工具](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/dev-guides-and-walkthroughs/tool-plugin.md) |
| 让一个新的 LLM、嵌入、重排序、TTS、STT 或内容审核模型可在 Dify 中选用 | [模型](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/dev-guides-and-walkthroughs/creating-new-model-provider.md) |
| 为 Agent 实现自定义推理循环（ReAct、Function Calling 变体等） | [Agent 策略](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/dev-guides-and-walkthroughs/agent-strategy-plugin.md) |
| 暴露一个 HTTP 端点，供外部服务调用以驱动 Dify 工作流 | [扩展（Endpoint）](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/dev-guides-and-walkthroughs/endpoint.md) |
| 将外部系统的文档导入知识库 | [数据源](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/dev-guides-and-walkthroughs/datasource-plugin.md) |
| 当上游发生某事时启动工作流（webhook 触发、文件到达） | [触发器](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/dev-guides-and-walkthroughs/trigger-plugin.md) |

## 常见问题

> [accordion] 一个插件能否组合多种类型？
>
> 可以。工具插件也能同时暴露端点。例如，一个 Discord 机器人插件在同一个包中既发送消息（工具），又接收 webhook（端点）。模型插件更为严格：它们不能捆绑工具或端点。

> [accordion] 工具与 Agent 策略：有什么区别？
>
> 工具是 Agent 决定调用的单项能力（如「搜索网页」）。Agent 策略则是 **推理循环本身**：它是决定调用哪些工具、按何种顺序调用、何时停止的策略。除非你要替换 Agent 的思考方式，否则应构建工具。

> [accordion] 数据源与触发器：两者都从外部系统拉取数据？
>
> 数据源将文档引入知识库以供检索。触发器在上游事件发生时实时启动工作流。两者可由相同的系统驱动，但消费模式不同：索引 vs 事件驱动执行。

> [accordion] 扩展与工具：何时该用纯 HTTP 端点？
>
> 扩展面向相反的方向：由外部服务调用 **进入** Dify。工具则用于 Agent 和工作流调用 **外部** 服务。当你的插件是入口而非动作时，构建扩展。

## 后续步骤

选定类型后，安装 CLI 并搭建项目骨架：

> [card] [安装 CLI](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/getting-started/cli.md)
>
> 在你的机器上获取 `dify` 并运行 `dify plugin init`。

> [card] [阅读 manifest 规范](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/features-and-specs/plugin-types/general-specifications.md)
>
> 了解每个插件共用的 YAML 结构。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.