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
type PluginType
author str None
name str pattern='^[a-z0-9_-]{1,128}$'
repo str None The repository URL of the plugin None
description I18nObject
icon str
icon_dark str None The dark mode icon of the plugin None
created_at datetime
resource PluginResourceRequirements
plugins Plugins
meta Meta

PluginType

Values

  • Plugin: plugin

ModelProviderHelp

Model provider help

Fields

Name Type Description Default Extra

ToolDescription

The description of the tool

Fields

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

ToolParameterOption

The option of the tool parameter

Fields

Name Type Description Default Extra
value str The value of the option
icon str None The icon of the option, can be a URL or a base64 encoded string None

DatasourceProviderType

Values

  • ONLINE_DOCUMENT: online_document
  • WEBSITE_CRAWL: website_crawl
  • ONLINE_DRIVE: online_drive

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
  • OBJECT: object
  • ARRAY: array
  • DYNAMIC_SELECT: dynamic-select

ParameterType

Values

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

DatasourceParameter

Parameter of datasource entity

Fields

Name Type Description Default Extra
name str The name of the parameter
placeholder dify_plugin.entities.I18nObject None The placeholder presented to the user None
scope str None None
auto_generate dify_plugin.entities.ParameterAutoGenerate None None
template dify_plugin.entities.ParameterTemplate None None
required bool False
default Union[int, float, str, NoneType] None
min Union[float, int, NoneType] None
max Union[float, int, NoneType] None
precision int None None
options list[ParameterOption]
type DatasourceParameterType The type of the parameter

ToolExtra

The extra of the tool

Fields

Name Type Description Default Extra
python Python

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 collections.abc.Mapping[str, typing.Any] None None

ModelFieldModelSchema

Field model schema

Fields

Name Type Description Default Extra
placeholder dify_plugin.entities.I18nObject None None

DatasourceLabelEnum

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

DatasourceProviderExtra

The extra of the datasource provider

Fields

Name Type Description Default Extra
python Python

ModelType

Values

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

ModelProviderCredentialSchema

Model provider credential schema

Fields

Name Type Description Default Extra
credential_form_schemas list[ModelCredentialFormSchema]

Datasource

Datasource entity

Fields

Name Type Description Default Extra
identity DatasourceIdentity
parameters list[DatasourceParameter]
output_schema dict[str, Any] Output schema definition
extra DatasourceEntityExtra

PluginArch

Values

  • AMD64: amd64
  • ARM64: arm64

I18nObject

Common i18n object

Fields

Name Type Description Default Extra
zh_Hans str None None
pt_BR str None None
ja_JP str None None
en_US str

DatasourceProvider

Manifest of datasource providers

Fields

Name Type Description Default Extra
identity DatasourceProviderIdentity The identity of the datasource provider
credentials_schema list[ProviderConfig] The credentials schema of the datasource provider
oauth_schema dify_plugin.entities.oauth.OAuthSchema None The OAuth schema of the datasource provider if OAuth is supported None
provider_type DatasourceProviderType The type of the datasource provider
datasources list[str] The datasources of the datasource provider
extra DatasourceProviderExtra The extra of the datasource provider

Tool

Permission of tool

Fields

Name Type Description Default Extra
enabled bool None 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

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

PluginProviderType

Values

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

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
  • RAG: rag
  • OTHER: other

Python

The extra of the agent strategy

Fields

Name Type Description Default Extra
source str

ModelFormOption

Form option

Fields

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

AgentStrategyParameter

The parameter of the agent strategy

Fields

Name Type Description Default Extra
name str The name of the parameter
help dify_plugin.entities.I18nObject None None
type ToolParameterType The type of the parameter
auto_generate dify_plugin.entities.tool.ParameterAutoGenerate None The auto generate of the parameter None
template dify_plugin.entities.tool.ParameterTemplate None The template of the parameter None
scope str None None
required bool None False
default Union[int, float, str, NoneType] None
min Union[float, int, NoneType] None
max Union[float, int, NoneType] None
precision int None None
options list[dify_plugin.entities.tool.ToolParameterOption] None 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

FetchFrom

Values

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

PriceConfig

The price config

Fields

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

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
oauth_schema dify_plugin.entities.oauth.OAuthSchema None The OAuth schema of the tool provider if OAuth is supported None
tools list[str] The tools of the tool provider []
extra ToolProviderExtra

Storage

Permission of storage

Fields

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

Meta

Meta information of plugin

Fields

Name Type Description Default Extra
version str The version of the manifest specification, designed for backward compatibility,when installing an older plugin to a newer Dify, it's hard to ensure breaking changes never happen, but at least, Dify can detect it by this field, it knows which version of the manifest is supported.
arch list[PluginArch]
runner PluginRunner
minimum_dify_version str None The minimum version of Dify, designed for forward compatibility.When installing a newer plugin to an older Dify, many new features may not be available,but showing the minimum Dify version helps users understand how to upgrade. None

ConfigOption

The option of the credentials

Fields

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

AgentStrategyFeature

Values

  • HISTORY_MESSAGES: history-messages

ParameterTemplate

The template of the parameter

Fields

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

DatasourceProviderIdentity

Identity of datasource provider

Fields

Name Type Description Default Extra
author str The author of the datasource
name str The name of the datasource
icon str The icon of the datasource
tags list[dify_plugin.entities.datasource_manifest.DatasourceLabelEnum] None The tags of the datasource []

ModelCredentialFormSchema

Credential form schema

Fields

Name Type Description Default Extra
variable str
type ModelFormType
required bool True
default str None None
options list[dify_plugin.entities.model.provider.FormOption] None None
placeholder dify_plugin.entities.I18nObject None None
max_length int 0
show_on list[ModelFormShowOnObject]

ToolProviderExtra

The extra of the tool provider

Fields

Name Type Description Default Extra
python Python

AIModelEntity

AI model entity

Fields

Name Type Description Default Extra
model str The model name
model_type ModelType The model type
features list[dify_plugin.entities.model.ModelFeature] None 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 dify_plugin.entities.model.PriceConfig None None

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

AgentStrategyProviderExtra

The extra of the agent provider

Fields

Name Type Description Default Extra
python Python

ModelProvider

Model provider configuration

Fields

Name Type Description Default Extra
provider str
description dify_plugin.entities.I18nObject None None
icon_small dify_plugin.entities.I18nObject None None
icon_large dify_plugin.entities.I18nObject None None
background str None None
help dify_plugin.entities.model.provider.ProviderHelpEntity None 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 dify_plugin.entities.model.provider.ProviderCredentialSchema None None
model_credential_schema dify_plugin.entities.model.provider.ModelCredentialSchema None None
position dify_plugin.entities.model.provider.ModelPosition None None
extra ModelProviderExtra

ParameterAutoGenerate

The auto generate of the parameter

Fields

Name Type Description Default Extra
type Type

ParameterOption

The option of the parameter

Fields

Name Type Description Default Extra
value str The value of the option
icon str None The icon of the option, can be a URL or a base64 encoded string None

ParameterAutoGenerate

The auto generate of the parameter

Fields

Name Type Description Default Extra
type Type

ModelPosition

Model position

Fields

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

ModelFormType

Values

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

ParameterRule

The parameter rule of the model

Fields

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

AgentStrategyExtra

The extra of the agent strategy

Fields

Name Type Description Default Extra
python Python

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 collections.abc.Mapping[str, typing.Any] None None
features list[AgentStrategyFeature] The features of the agent []

ModelConfigurateMethod

Values

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

App

Permission of app

Fields

Name Type Description Default Extra
enabled bool None Whether to enable invocation of app False

AppSelectorScope

Values

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

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
datasources list[str] manifest paths of datasource providers in yaml format refers to DatasourceProvider

Model

Permission of model

Fields

Name Type Description Default Extra
enabled bool None Whether to enable invocation of model False
llm bool None Whether to enable invocation of llm False
text_embedding bool None Whether to enable invocation of text embedding False
rerank bool None Whether to enable invocation of rerank False
tts bool None Whether to enable invocation of tts False
speech2text bool None Whether to enable invocation of speech2text False
moderation bool None Whether to enable invocation of moderation False

DatasourceEntityExtra

The extra of the datasource entity

Fields

Name Type Description Default Extra
python Python

Endpoint

Permission of endpoint

Fields

Name Type Description Default Extra
enabled bool None Whether to enable registration of endpoint False

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

OAuthSchema

The schema of the OAuth

Fields

Name Type Description Default Extra
client_schema collections.abc.Sequence[dify_plugin.entities.provider_config.ProviderConfig] The schema of the OAuth client
credentials_schema collections.abc.Sequence[dify_plugin.entities.provider_config.ProviderConfig] The schema of the OAuth credentials

Permission

Permission of plugin

Fields

Name Type Description Default Extra
tool dify_plugin.core.entities.plugin.setup.PluginResourceRequirements.Permission.Tool None Permission of tool None
model dify_plugin.core.entities.plugin.setup.PluginResourceRequirements.Permission.Model None Permission of model None
node dify_plugin.core.entities.plugin.setup.PluginResourceRequirements.Permission.Node None Permission of node None
endpoint dify_plugin.core.entities.plugin.setup.PluginResourceRequirements.Permission.Endpoint None Permission of endpoint None
app dify_plugin.core.entities.plugin.setup.PluginResourceRequirements.Permission.App None Permission of app None
storage dify_plugin.core.entities.plugin.setup.PluginResourceRequirements.Permission.Storage None Permission of storage None

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, bool, NoneType] None
options list[dify_plugin.entities.provider_config.ConfigOption] None None
help dify_plugin.entities.I18nObject None None
url str None None
placeholder dify_plugin.entities.I18nObject None None

PluginLanguage

Values

  • PYTHON: python

DatasourceIdentity

Identity of datasource entity

Fields

Name Type Description Default Extra
author str The author of the datasource
name str The name of the datasource
icon str None 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

EndpointExtra

The extra of the endpoint

Fields

Name Type Description Default Extra
python Python

ModelProviderExtra

Model provider configuration extra

Fields

Name Type Description Default Extra
python Python

PluginResourceRequirements

Resource requirements of plugin

Fields

Name Type Description Default Extra
memory int
permission dify_plugin.core.entities.plugin.setup.PluginResourceRequirements.Permission None Permission of plugin None

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

ProviderModel

The provider model

Fields

Name Type Description Default Extra
model str The model name
model_type ModelType The model type
features list[dify_plugin.entities.model.ModelFeature] None 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

ModelConfigScope

Values

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

ModelFormShowOnObject

Form show on

Fields

Name Type Description Default Extra
variable str
value str

ToolSelectorScope

Values

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

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
icon_dark str None The dark mode icon of the tool None
tags list[ToolLabelEnum] The tags of the tool []

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
icon_dark str None The dark mode icon of the tool None
tags list[ToolLabelEnum] The tags of the tool []

Python

The extra of the agent provider

Fields

Name Type Description Default Extra
source str

Node

Permission of node

Fields

Name Type Description Default Extra
enabled bool None Whether to enable invocation of node False

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 dify_plugin.entities.tool.ParameterAutoGenerate None The auto generate of the parameter None
template dify_plugin.entities.tool.ParameterTemplate None The template of the parameter None
scope str None None
form ToolParameterForm The form of the parameter, schema/form/llm
llm_description str None None
required bool None False
default Union[int, float, str, NoneType] None
min Union[float, int, NoneType] None
max Union[float, int, NoneType] None
precision int None None
options list[dify_plugin.entities.tool.ToolParameterOption] None None
input_schema collections.abc.Mapping[str, typing.Any] None None

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 []

PluginRunner

Runner of plugin

Fields

Name Type Description Default Extra
language PluginLanguage
version str
entrypoint str