Skip to main content

本文档由 AI 自动翻译。如有任何不准确之处,请参考 英文原版。

本页介绍所有插件类型共享的结构。建议结合 插件开发基本概念 和 开发者速查表 一起阅读,以了解整体架构。

路径规范#

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

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

通用结构#

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

I18nObject#

I18nObject 是符合 IETF BCP 47 标准的国际化结构,支持四种语言:

en_USstring#

英语(美国)。

zh_Hansstring#

简体中文。

ja_JPstring#

日语。

pt_BRstring#

葡萄牙语(巴西)。

ProviderConfig#

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

namestring#

表单项名称。

labelI18nObjectrequired#

显示标签,遵循 IETF BCP 47 标准。

typeprovider_config_typerequired#

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

scopeprovider_config_scope#

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

requiredboolean#

该字段是否不能为空。

defaultany#

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

optionsarray[provider_config_option]#

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

helperobject#

帮助文档链接标签,遵循 IETF BCP 47。

urlstring#

帮助文档链接。

placeholderobject#

多语言占位符文本,遵循 IETF BCP 47。

ProviderConfigOption (object)#

valuestringrequired#

选项的值。

labelobjectrequired#

选项的显示标签,遵循 IETF BCP 47。

ProviderConfigType (string)#

secret-inputstring#

将被加密的配置信息。

text-inputstring#

纯文本输入字段。

selectstring#

下拉选择字段。

booleanboolean#

开关/切换控件。

model-selectorobject#

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

app-selectorobject#

应用 ID 选择器。

tool-selectorobject#

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

dataset-selectorstring#

数据集选择器(待定)。

ProviderConfigScope (string)#

当 type 为 model-selector 时:

allstring#

所有模型类型。

llmstring#

仅大语言模型。

text-embeddingstring#

仅文本嵌入模型。

rerankstring#

仅重排序模型。

ttsstring#

仅文字转语音模型。

speech2textstring#

仅语音转文字模型。

moderationstring#

仅内容审核模型。

visionstring#

仅视觉模型。

当 type 为 app-selector 时:

allstring#

所有应用类型。

chatstring#

仅聊天应用。

workflowstring#

仅 Workflow 应用。

completionstring#

仅补全应用。

当 type 为 tool-selector 时:

allstring#

所有工具类型。

pluginstring#

仅插件工具。

apistring#

仅 API 工具。

workflowstring#

仅工作流工具。

ModelConfig#

providerstring#

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

modelstring#

具体的模型名称。

model_typeenum#

模型类型枚举,参见 模型设计规则。

NodeResponse#

inputsdict#

最终传入节点的变量。

outputsdict#

节点的输出结果。

process_datadict#

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

ToolSelector#

provider_idstring#

工具供应商名称。

tool_namestring#

工具名称。

tool_descriptionstring#

工具描述。

tool_configurationdict[string, any]#

工具配置信息。

tool_parametersdict[string, dict]#

需要 LLM 推理的参数。

namestring#

参数名称。

typestring#

参数类型。

requiredboolean#

该参数是否必填。

descriptionstring#

参数描述。

defaultany#

默认值。

optionsarray[string]#

该参数的可用选项。

相关资源#