Skip to content

Dify Plugin SDK Schema Documentation

Table of Contents

Manifest

The Manifest of the plugin

Fields

Name Type Description Default Extra
version str pattern='^\d{1,4}(\.\d{1,4}){1,3}(-\w{1,16})?$'
type PluginType
author Union[str, NoneType] pattern='^[a-zA-Z0-9_-]{1,64}$'
name str pattern='^[a-z0-9_-]{1,128}$'
repo Union[str, NoneType] The repository URL of the plugin None
description I18nObject
icon str
created_at datetime
resource PluginResourceRequirements
plugins Plugins
meta Meta

AgentStrategyParameter

The parameter of the agent strategy

Fields

Name Type Description Default Extra
name str The name of the parameter
help Union[I18nObject, NoneType] None
type ToolParameterType The type of the parameter
auto_generate Union[ParameterAutoGenerate, NoneType] The auto generate of the parameter None
template Union[ParameterTemplate, NoneType] The template of the parameter None
scope str None None
required Union[bool, NoneType] False
default Union[int, float, str, NoneType] None
min Union[float, int, NoneType] None
max Union[float, int, NoneType] None
precision Union[int, NoneType] None
options Union[list[ToolParameterOption], NoneType] None

ModelConfigScope

Values

  • LLM: llm
  • TEXT_EMBEDDING: text-embedding
  • RERANK: rerank
  • TTS: tts
  • SPEECH2TEXT: speech2text
  • MODERATION: moderation
  • VISION: vision

ParameterAutoGenerate

The auto generate of the parameter

Fields

Name Type Description Default Extra
type Type

ModelProviderExtra

Model provider configuration extra

Fields

Name Type Description Default Extra
python Python

Tool

Permission of tool

Fields

Name Type Description Default Extra
enabled Union[bool, NoneType] False

ToolDescription

The description of the tool

Fields

Name Type Description Default Extra
llm str The description presented to the LLM

ModelConfigurateMethod

Values

  • PREDEFINED_MODEL: predefined-model
  • CUSTOMIZABLE_MODEL: customizable-model

Node

Permission of node

Fields

Name Type Description Default Extra
enabled Union[bool, NoneType] Whether to enable invocation of node False

ToolProviderExtra

The extra of the tool provider

Fields

Name Type Description Default Extra
python Python

ToolExtra

The extra of the tool

Fields

Name Type Description Default Extra
python Python

ParameterTemplate

The template of the parameter

Fields

Name Type Description Default Extra
enabled bool Whether the parameter is jinja enabled

ToolLabelEnum

Values

  • SEARCH: search
  • IMAGE: image
  • VIDEOS: videos
  • WEATHER: weather
  • FINANCE: finance
  • DESIGN: design
  • TRAVEL: travel
  • SOCIAL: social
  • NEWS: news
  • MEDICAL: medical
  • PRODUCTIVITY: productivity
  • EDUCATION: education
  • BUSINESS: business
  • ENTERTAINMENT: entertainment
  • UTILITIES: utilities
  • OTHER: other

CommonParameterType

Values

  • SECRET_INPUT: secret-input
  • TEXT_INPUT: text-input
  • SELECT: select
  • STRING: string
  • NUMBER: number
  • FILE: file
  • FILES: files
  • BOOLEAN: boolean
  • APP_SELECTOR: app-selector
  • MODEL_SELECTOR: model-selector
  • TOOLS_SELECTOR: array[tools]
  • ANY: any

Tool

The manifest of the tool

Fields

Name Type Description Default Extra
identity ToolIdentity
parameters list[ToolParameter] The parameters of the tool []
description ToolDescription
extra ToolExtra
has_runtime_parameters bool Whether the tool has runtime parameters False
output_schema Union[collections.abc.Mapping[str, typing.Any], NoneType] None

PluginResourceRequirements

Resource requirements of plugin

Fields

Name Type Description Default Extra
memory int
permission Union[Permission, NoneType] Permission of plugin None

AgentStrategy

The Manifest of the agent strategy

Fields

Name Type Description Default Extra
identity AgentStrategyIdentity
parameters list[AgentStrategyParameter] The parameters of the agent []
extra AgentStrategyExtra
has_runtime_parameters bool Whether the tool has runtime parameters False
output_schema Union[collections.abc.Mapping[str, typing.Any], NoneType] None
features list[AgentStrategyFeature] The features of the agent []

PriceConfig

The price config

Fields

Name Type Description Default Extra
input Decimal Input price
output Union[Decimal, NoneType] Output price None
unit Decimal Unit, e.g. 0.0001 -> per 10000 tokens
currency str Currency, e.g. USD

App

Permission of app

Fields

Name Type Description Default Extra
enabled Union[bool, NoneType] Whether to enable invocation of app False

DefaultParameterName

Values

  • TEMPERATURE: temperature
  • TOP_P: top_p
  • TOP_K: top_k
  • PRESENCE_PENALTY: presence_penalty
  • FREQUENCY_PENALTY: frequency_penalty
  • MAX_TOKENS: max_tokens
  • RESPONSE_FORMAT: response_format
  • JSON_SCHEMA: json_schema

AgentStrategyFeature

Values

  • HISTORY_MESSAGES: history-messages

ToolSelectorScope

Values

  • ALL: all
  • PLUGIN: plugin
  • API: api
  • WORKFLOW: workflow

ToolParameter

The type of the parameter

Fields

Name Type Description Default Extra
name str The name of the parameter
type ToolParameterType The type of the parameter
auto_generate Union[ParameterAutoGenerate, NoneType] The auto generate of the parameter None
template Union[ParameterTemplate, NoneType] The template of the parameter None
scope str None None
form ToolParameterForm The form of the parameter, schema/form/llm
llm_description Union[str, NoneType] None
required Union[bool, NoneType] False
default Union[int, float, str, NoneType] None
min Union[float, int, NoneType] None
max Union[float, int, NoneType] None
precision Union[int, NoneType] None
options Union[list[ToolParameterOption], NoneType] None

ConfigOption

The option of the credentials

Fields

Name Type Description Default Extra
value str The value of the option

AgentStrategyProvider

The Manifest of the agent strategy provider

Fields

Name Type Description Default Extra
identity AgentStrategyProviderIdentity
strategies list[str] The strategies of the agent provider []

ModelProviderHelp

Model provider help

Fields

Name Type Description Default Extra

ModelFormOption

Form option

Fields

Name Type Description Default Extra
value str
show_on list[ModelFormShowOnObject]

Endpoint

The Manifest of the endpoint

Fields

Name Type Description Default Extra
path str
method str
hidden bool Whether to hide this endpoint in the UI False
extra EndpointExtra

Plugins

Extensions of plugin

Fields

Name Type Description Default Extra
tools list[str] manifest paths of tool providers in yaml format, refers to ToolProvider
models list[str] manifest paths of model providers in yaml format, refers to ModelProvider
endpoints list[str] manifest paths of endpoint groups in yaml format, refers to EndpointGroup
agent_strategies list[str] manifest paths of agent strategy providers in yaml format,refers to AgentStrategyProvider

Meta

Meta information of plugin

Fields

Name Type Description Default Extra
version str
arch list[PluginArch]
runner PluginRunner
minimum_dify_version Union[str, NoneType] None pattern='^\d{1,4}(\.\d{1,4}){1,3}(-\w{1,16})?$'

ModelType

Values

  • LLM: llm
  • TEXT_EMBEDDING: text-embedding
  • RERANK: rerank
  • SPEECH2TEXT: speech2text
  • MODERATION: moderation
  • TTS: tts
  • TEXT2IMG: text2img

AIModelEntity

AI model entity

Fields

Name Type Description Default Extra
model str The model name
model_type ModelType The model type
features Union[list[ModelFeature], NoneType] The features of the model None
fetch_from FetchFrom The fetch from FetchFrom.PREDEFINED_MODEL
model_properties dict[ModelPropertyKey, Any] The model properties
deprecated bool Whether the model is deprecated False
parameter_rules list[ParameterRule] []
pricing Union[PriceConfig, NoneType] None

ProviderModel

The provider model

Fields

Name Type Description Default Extra
model str The model name
model_type ModelType The model type
features Union[list[ModelFeature], NoneType] The features of the model None
fetch_from FetchFrom The fetch from FetchFrom.PREDEFINED_MODEL
model_properties dict[ModelPropertyKey, Any] The model properties
deprecated bool Whether the model is deprecated False

ModelFormType

Values

  • TEXT_INPUT: text-input
  • SECRET_INPUT: secret-input
  • SELECT: select
  • RADIO: radio
  • SWITCH: switch

AppSelectorScope

Values

  • ALL: all
  • CHAT: chat
  • WORKFLOW: workflow
  • COMPLETION: completion

PluginProviderType

Values

  • Tool: tool
  • Model: model
  • Endpoint: endpoint

FetchFrom

Values

  • PREDEFINED_MODEL: predefined-model
  • CUSTOMIZABLE_MODEL: customizable-model

ParameterRule

The parameter rule of the model

Fields

Name Type Description Default Extra
name str The name of the parameter
use_template Union[str, NoneType] The template of the parameter None
type ParameterType The type of the parameter
help Union[I18nObject, NoneType] The help of the parameter None
required bool Whether the parameter is required False
default Union[Any, NoneType] The default value of the parameter None
min Union[float, NoneType] The minimum value of the parameter None
max Union[float, NoneType] The maximum value of the parameter None
precision Union[int, NoneType] The precision of the parameter None
options list[str] The options of the parameter []

ToolProviderIdentity

The identity of the tool provider

Fields

Name Type Description Default Extra
author str The author of the tool
name str The name of the tool
icon str The icon of the tool
tags list[ToolLabelEnum] The tags of the tool []

AgentStrategyIdentity

The identity of the agent strategy

Fields

Name Type Description Default Extra
author str The author of the tool
name str The name of the tool

PluginRunner

Runner of plugin

Fields

Name Type Description Default Extra
language PluginLanguage
version str
entrypoint str

ToolProvider

The Manifest of the tool provider

Fields

Name Type Description Default Extra
identity ToolProviderIdentity
credentials_schema list[ProviderConfig] The credentials schema of the tool provider
tools list[str] The tools of the tool provider []
extra ToolProviderExtra

ModelProvider

Model provider configuration

Fields

Name Type Description Default Extra
provider str
description Union[I18nObject, NoneType] None
icon_small Union[I18nObject, NoneType] None
icon_large Union[I18nObject, NoneType] None
background Union[str, NoneType] None
help Union[ModelProviderHelp, NoneType] None
supported_model_types collections.abc.Sequence[dify_plugin.entities.model.ModelType]
configurate_methods list[ModelConfigurateMethod]
models list[str] Paths to yaml files that will be loaded as AIModelEntity
provider_credential_schema Union[ModelProviderCredentialSchema, NoneType] None
model_credential_schema Union[ModelCredentialSchema, NoneType] None
position Union[ModelPosition, NoneType] None
extra ModelProviderExtra

Python

The extra of the agent strategy

Fields

Name Type Description Default Extra
source str

Storage

Permission of storage

Fields

Name Type Description Default Extra
enabled Union[bool, NoneType] Whether to enable uses of storage False
size int Size of storage 1048576 Ge(ge=1024) Le(le=1073741824)

Permission

Permission of plugin

Fields

Name Type Description Default Extra
tool Union[Tool, NoneType] Permission of tool None
model Union[Model, NoneType] Permission of model None
node Union[Node, NoneType] Permission of node None
endpoint Union[Endpoint, NoneType] Permission of endpoint None
app Union[App, NoneType] Permission of app None
storage Union[Storage, NoneType] Permission of storage None

ModelPropertyKey

Values

  • MODE: mode
  • CONTEXT_SIZE: context_size
  • MAX_CHUNKS: max_chunks
  • FILE_UPLOAD_LIMIT: file_upload_limit
  • SUPPORTED_FILE_EXTENSIONS: supported_file_extensions
  • MAX_CHARACTERS_PER_CHUNK: max_characters_per_chunk
  • DEFAULT_VOICE: default_voice
  • VOICES: voices
  • WORD_LIMIT: word_limit
  • AUDIO_TYPE: audio_type
  • MAX_WORKERS: max_workers

Python

The extra of the agent provider

Fields

Name Type Description Default Extra
source str

ToolParameterOption

The option of the tool parameter

Fields

Name Type Description Default Extra
value str The value of the option

EndpointExtra

The extra of the endpoint

Fields

Name Type Description Default Extra
python Python

ProviderConfig

A common config schema

Fields

Name Type Description Default Extra
name str The name of the credentials
type Config The type of the credentials
scope str None None
required bool False
default Union[int, float, str, NoneType] None
options Union[list[ConfigOption], NoneType] None
help Union[I18nObject, NoneType] None
url Union[str, NoneType] None
placeholder Union[I18nObject, NoneType] None

ModelFeature

Values

  • TOOL_CALL: tool-call
  • MULTI_TOOL_CALL: multi-tool-call
  • AGENT_THOUGHT: agent-thought
  • VISION: vision
  • STREAM_TOOL_CALL: stream-tool-call
  • DOCUMENT: document
  • VIDEO: video
  • AUDIO: audio
  • STRUCTURED_OUTPUT: structured-output

Endpoint

Permission of endpoint

Fields

Name Type Description Default Extra
enabled Union[bool, NoneType] Whether to enable registration of endpoint False

ModelFormShowOnObject

Form show on

Fields

Name Type Description Default Extra
variable str
value str

AgentStrategyProviderIdentity

The identity of the agent strategy provider

Fields

Name Type Description Default Extra
author str The author of the tool
name str The name of the tool
icon str The icon of the tool
tags list[ToolLabelEnum] The tags of the tool []

AgentStrategyExtra

The extra of the agent strategy

Fields

Name Type Description Default Extra
python Python

ModelFieldModelSchema

Field model schema

Fields

Name Type Description Default Extra
placeholder Union[I18nObject, NoneType] None

ModelCredentialFormSchema

Credential form schema

Fields

Name Type Description Default Extra
variable str
type ModelFormType
required bool True
default Union[str, NoneType] None
options Union[list[ModelFormOption], NoneType] None
placeholder Union[I18nObject, NoneType] None
max_length int 0
show_on list[ModelFormShowOnObject]

AgentStrategyProviderExtra

The extra of the agent provider

Fields

Name Type Description Default Extra
python Python

PluginType

Values

  • Plugin: plugin

ModelProviderCredentialSchema

Model provider credential schema

Fields

Name Type Description Default Extra
credential_form_schemas list[ModelCredentialFormSchema]

ModelPosition

Model position

Fields

Name Type Description Default Extra
llm Union[list[str], NoneType] Sorts of llm model in ascending order, fill model name here
text_embedding Union[list[str], NoneType] Sorts of text embedding model in ascending order, fill model name here
rerank Union[list[str], NoneType] Sorts of rerank model in ascending order, fill model name here
tts Union[list[str], NoneType] Sorts of tts model in ascending order, fill model name here
speech2text Union[list[str], NoneType] Sorts of speech2text model in ascending order, fill model name here
moderation Union[list[str], NoneType] Sorts of moderation model in ascending order, fill model name here

I18nObject

Common i18n object

Fields

Name Type Description Default Extra
zh_Hans Union[str, NoneType] None
pt_BR Union[str, NoneType] None
en_US str

EndpointGroup

The Manifest of the endpoint group

Fields

Name Type Description Default Extra
settings list[ProviderConfig]
endpoints list[str] Paths to yaml files that will be loaded as Endpoint

PluginArch

Values

  • AMD64: amd64
  • ARM64: arm64

Model

Permission of model

Fields

Name Type Description Default Extra
enabled Union[bool, NoneType] Whether to enable invocation of model False
llm Union[bool, NoneType] Whether to enable invocation of llm False
text_embedding Union[bool, NoneType] Whether to enable invocation of text embedding False
rerank Union[bool, NoneType] Whether to enable invocation of rerank False
tts Union[bool, NoneType] Whether to enable invocation of tts False
speech2text Union[bool, NoneType] Whether to enable invocation of speech2text False
moderation Union[bool, NoneType] Whether to enable invocation of moderation False

PluginLanguage

Values

  • PYTHON: python

ToolIdentity

The identity of the tool

Fields

Name Type Description Default Extra
author str The author of the tool
name str The name of the tool

ParameterType

Values

  • FLOAT: float
  • INT: int
  • STRING: string
  • BOOLEAN: boolean
  • TEXT: text