Skip to main content

Dify Plugin SDK

A Python SDK for building plugins for Dify.

Here is a short introduction to Dify Plugin: https://docs.dify.ai/plugins/introduction

Development

This repository uses just as its command runner. Install it with your preferred package manager, or with uv:

uv tool install rust-just

Common development commands:

just dev       # Sync default dev dependencies
just fmt       # Apply formatting fixes
just lint      # Format and apply lint fixes
just check     # Check lockfile, formatting, and linting
just test      # Run SDK tests
just build     # Build source and wheel distributions
just docs      # Generate schema documentation

Production Plugin Examples

See langgenius/dify-official-plugins for production plugin implementations that are published and used by Dify.

LLM Polling Support

SDK 0.9.0 adds support for polling-based LLM invocation. A model can now declare the polling feature and implement polling methods, allowing plugins to submit long-running provider jobs and return later checks through a short request/response flow.

Polling results use three states:

  • running returns plugin-owned state for the next check.
  • succeeded returns the final LLM result.
  • failed returns a terminal error.

Version Management

This SDK follows Semantic Versioning (a.b.c):

  • a: Major version - Indicates significant architectural changes or incompatible API modifications
  • b: Minor version - Indicates new feature additions while maintaining backward compatibility
  • c: Patch version - Indicates backward-compatible bug fixes

For SDK Users

When depending on this SDK, it's recommended to specify version constraints that:

  • Allow patch and minor updates for bug fixes and new features
  • Prevent major version updates to avoid breaking changes

Example in your project's dependency management:

dify_plugin >= 0.8

Manifest Version Reference

For the manifest specification, we've introduced two versioning fields:

  • meta.version - The version of the manifest specification, designed for backward compatibility. When installing an older plugin to a newer Dify, it's difficult to ensure breaking changes never occur, but at least Dify can detect them through this field. Once an unsupported version is detected, Dify will only use the supported parts of the plugin.
  • meta.minimum_dify_version - 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.

Meta.Version Reference

Manifest Version Description
0.0.2 As ToolProviderType now supports mcp, an elder implementation is going to broken when user selected a mcp tool in Dify, so we bump it to 0.0.2 to ensure Dify knows that mcp is disabled if meta.version under 0.0.2.
0.0.1 Initial release

Meta.MinimumDifyVersion Reference

Minimum Dify Version SDK Version Description
1.2.0 0.2.0 Support fetching application info
1.4.0 0.0.1-beta.49 Support LLM multimodal output
1.4.0 0.3.1 Support OAuth functionality for plugins
1.5.1 0.4.0 Support dynamic-select parameter type
1.5.1 0.4.0 Support LLM structured output
1.6.0 0.4.1 Support dark-icon field in manifest
1.7.0 0.4.2 Support OAuth functionality for plugins
1.8.1 0.4.4 Support filename in MultiModalPromptMessageContent
1.9.0 0.5.0 Support Datasource functionality for plugins
1.10.0 0.6.0 Support Trigger functionality for plugins
1.11.0 0.7.0 Support Multimodal Reranking / Embeddings
1.14.0 0.8.1 Dependency and project structure cleanup
1.14.2 0.9.0 Support polling-based LLM plugin invocations

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dify_plugin-0.10.1.tar.gz (320.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dify_plugin-0.10.1-py3-none-any.whl (379.3 kB view details)

Uploaded Python 3

File details

Details for the file dify_plugin-0.10.1.tar.gz.

File metadata

  • Download URL: dify_plugin-0.10.1.tar.gz
  • Upload date:
  • Size: 320.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dify_plugin-0.10.1.tar.gz
Algorithm Hash digest
SHA256 875fe38d7a97d05fabb3b4f1ab467f2dc50ad2458a1eac68e6e212e29e7e1d29
MD5 b277fb44431dc91aeeb8baaed98c1fd5
BLAKE2b-256 2bbca8dd795c7dd33947a90a2832a7d32c6b7f5a771554cb3890369244d72331

See more details on using hashes here.

Provenance

The following attestation bundles were made for dify_plugin-0.10.1.tar.gz:

Publisher: release.yml on langgenius/dify-plugin-sdks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dify_plugin-0.10.1-py3-none-any.whl.

File metadata

  • Download URL: dify_plugin-0.10.1-py3-none-any.whl
  • Upload date:
  • Size: 379.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for dify_plugin-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b36161c72d4235af4241b8e417edea78689f3d6e4598cf2368b2a1523bf96809
MD5 0095971049c8011f7ad38e1e7668e395
BLAKE2b-256 22d121ef487ef4bbb38ea1e19489a2c7a81f4a91865ba91fedd921226ede862c

See more details on using hashes here.

Provenance

The following attestation bundles were made for dify_plugin-0.10.1-py3-none-any.whl:

Publisher: release.yml on langgenius/dify-plugin-sdks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.10.2

2 files

This release

0.10.1 This release

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page