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

# 通用规范

> 各类插件共享的通用数据结构，包括 I18nObject、ProviderConfig、ModelConfig、NodeResponse 和 ToolSelector

本页介绍所有插件类型共享的结构。建议结合 [插件开发基本概念](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/getting-started/getting-started-dify-plugin.md) 和 [开发者速查表](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/getting-started/cli.md) 一起阅读，以了解整体架构。

## 路径规范

在 Manifest 或任何 YAML 文件中填写文件路径时，根据文件类型遵循以下两条规则：

* 图片、视频等多媒体文件（例如插件的 `icon`），放在插件根目录下的 `_assets` 文件夹中。
* 普通文本文件，如 `.py` 或 `.yaml` 代码文件，使用其在插件项目中的绝对路径引用。

## 通用结构

部分数据结构在工具、模型和 Endpoint 之间共享，在此统一定义。

### I18nObject

`I18nObject` 是符合 [IETF BCP 47](https://tools.ietf.org/html/bcp47) 标准的国际化结构，支持四种语言：

**en\_US** `string`

英语（美国）。

**zh\_Hans** `string`

简体中文。

**ja\_JP** `string`

日语。

**pt\_BR** `string`

葡萄牙语（巴西）。

### ProviderConfig

`ProviderConfig` 是供应商通用表单结构，`Tool` 和 `Endpoint` 都会使用。

**name** `string`

表单项名称。

**label** `I18nObject` *required*

显示标签，遵循 [IETF BCP 47](https://tools.ietf.org/html/bcp47) 标准。

**type** `provider_config_type` *required*

表单字段类型，决定该字段在 UI 中的渲染方式。

**scope** `provider_config_scope`

可选的范围限定，随 `type` 的取值而变化。

**required** `boolean`

该字段是否不能为空。

**default** `any`

默认值。仅支持基本类型：`float`、`int`、`string`。

**options** `array[provider_config_option]`

可用选项。仅在 `type` 为 `select` 时使用。

**helper** `object`

帮助文档链接标签，遵循 [IETF BCP 47](https://tools.ietf.org/html/bcp47)。

**url** `string`

帮助文档链接。

**placeholder** `object`

多语言占位符文本，遵循 [IETF BCP 47](https://tools.ietf.org/html/bcp47)。

### ProviderConfigOption (object)

**value** `string` *required*

选项的值。

**label** `object` *required*

选项的显示标签，遵循 [IETF BCP 47](https://tools.ietf.org/html/bcp47)。

### ProviderConfigType (string)

**secret-input** `string`

将被加密的配置信息。

**text-input** `string`

纯文本输入字段。

**select** `string`

下拉选择字段。

**boolean** `boolean`

开关/切换控件。

**model-selector** `object`

模型配置选择器，包含供应商名称、模型名称和模型参数。

**app-selector** `object`

应用 ID 选择器。

**tool-selector** `object`

工具配置选择器，包含工具供应商、名称和参数。

**dataset-selector** `string`

数据集选择器（待定）。

### ProviderConfigScope (string)

当 `type` 为 `model-selector` 时：

**all** `string`

所有模型类型。

**llm** `string`

仅大语言模型。

**text-embedding** `string`

仅文本嵌入模型。

**rerank** `string`

仅重排序模型。

**tts** `string`

仅文字转语音模型。

**speech2text** `string`

仅语音转文字模型。

**moderation** `string`

仅内容审核模型。

**vision** `string`

仅视觉模型。

当 `type` 为 `app-selector` 时：

**all** `string`

所有应用类型。

**chat** `string`

仅聊天应用。

**workflow** `string`

仅 Workflow 应用。

**completion** `string`

仅补全应用。

当 `type` 为 `tool-selector` 时：

**all** `string`

所有工具类型。

**plugin** `string`

仅插件工具。

**api** `string`

仅 API 工具。

**workflow** `string`

仅工作流工具。

### ModelConfig

**provider** `string`

包含 `plugin_id` 的模型供应商名称，格式为 `langgenius/openai/openai`。

**model** `string`

具体的模型名称。

**model\_type** `enum`

模型类型枚举，参见 [模型设计规则](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/features-and-specs/plugin-types/model-designing-rules.md#modeltype)。

### NodeResponse

**inputs** `dict`

最终传入节点的变量。

**outputs** `dict`

节点的输出结果。

**process\_data** `dict`

节点执行期间生成的数据。

### ToolSelector

**provider\_id** `string`

工具供应商名称。

**tool\_name** `string`

工具名称。

**tool\_description** `string`

工具描述。

**tool\_configuration** `dict[string, any]`

工具配置信息。

**tool\_parameters** `dict[string, dict]`

需要 LLM 推理的参数。

**name** `string`

参数名称。

**type** `string`

参数类型。

**required** `boolean`

该参数是否必填。

**description** `string`

参数描述。

**default** `any`

默认值。

**options** `array[string]`

该参数的可用选项。

## 相关资源

* [插件开发基本概念](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/getting-started/getting-started-dify-plugin.md)：Dify 插件开发总览
* [开发者速查表](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/dev-guides-and-walkthroughs/cheatsheet.md)：常用命令和概念的快速参考
* [工具插件开发详解](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/dev-guides-and-walkthroughs/tool-plugin.md)：定义插件信息及工具插件开发流程
* [模型设计规则](https://enterprise-docs.dify.ai/zh/3.14.x/develop/plugins/features-and-specs/plugin-types/model-designing-rules.md)：模型配置的相关标准


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