This document provides a detailed introduction to the common structures and specifications in Dify plugin development, including path specifications, internationalization objects (I18nObject), provider form structures (ProviderConfig), model configurations (ModelConfig), node responses (NodeResponse), and tool selectors (ToolSelector), defining these important data structures and their uses.
This article will briefly introduce common structures in plugin development. During development, it is strongly recommended to read this alongside Basic Concepts of Plugin Development and the Developer Cheatsheet for a better understanding of the overall architecture.
When filling in file paths in Manifest or any yaml files, follow these two specifications depending on the type of file:
icon
, you should place these files in the _assets
folder under the plugin’s root directory..py
or .yaml
code files, you should fill in the absolute path of the file within the plugin project.When defining plugins, there are some data structures that can be shared between tools, models, and Endpoints. These shared structures are defined here.
I18nObject
is an internationalization structure that conforms to the IETF BCP 47 standard. Currently, four languages are supported:
ProviderConfig
is a common provider form structure, applicable to both Tool
and Endpoint
name
(string): Form item namelabel
(I18nObject, required): Following IETF BCP 47type
(provider_config_type, required): Form typescope
(provider_config_scope): Optional range, varies based on type
required
(bool): Cannot be emptydefault
(any): Default value, only supports basic types float
int
string
options
(list[provider_config_option]): Options, only used when type is select
helper
(object): Help document link label, following IETF BCP 47url
(string): Help document linkplaceholder
(object): Following IETF BCP 47value
(string, required): Valuelabel
(object, required): Following IETF BCP 47secret-input
(string): Configuration information will be encryptedtext-input
(string): Plain textselect
(string): Dropdownboolean
(bool): Switchmodel-selector
(object): Model configuration information, including provider name, model name, model parameters, etc.app-selector
(object): app idtool-selector
(object): Tool configuration information, including tool provider, name, parameters, etc.dataset-selector
(string): TBDtype
is model-selector
all
llm
text-embedding
rerank
tts
speech2text
moderation
vision
type
is app-selector
all
chat
workflow
completion
type
is tool-selector
all
plugin
api
workflow
provider
(string): Model provider name containing plugin_id, in the form of langgenius/openai/openai
.model
(string): Specific model name.model_type
(enum): Enumeration of model types, refer to the Model Design Rules document.inputs
(dict): Variables that are finally input to the node.outputs
(dict): Output results of the node.process_data
(dict): Data generated during node execution.provider_id
(string): Tool provider nametool_name
(string): Tool nametool_description
(string): Tool descriptiontool_configuration
(dict[str, Any]): Tool configuration informationtool_parameters
(dict[str, dict]): Parameters that need LLM reasoning
name
(string): Parameter nametype
(string): Parameter typerequired
(bool): Whether requireddescription
(string): Parameter descriptiondefault
(any): Defaultoptions
(list[string]): OptionsEdit this page | Report an issue