Support for multi providers in a single plugin? #38512
Replies: 2 comments
|
Good question. Based on looking at the codebase, the current design intent is one provider per plugin, even though the manifest schema technically uses list fields. The So in practice, the intended approach for your use case would be to either:
Option 1 is more aligned with the current architecture. If you want to reduce maintenance burden for shared logic, you could extract common code into a shared library/module that each plugin imports internally. It might be worth filing a feature request if you'd like the daemon to actually honor the full list in the To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
|
Short answer: a single plugin package can carry only one provider per type. The fact that Why
Net effect: only the last YAML in the list survives, the rest are silently dropped. That is why adding a second element to What to use instead1. One provider, multiple credential sets — best fit when only credentials differ.
2. Bundle — if the systems need genuinely different tool sets. dify bundle init
dify-plugin bundle append package . --package_path=./system_a.difypkg
dify-plugin bundle append package . --package_path=./system_b.difypkg
dify-plugin bundle package ./bundleEach plugin keeps its own provider and credentials; users still install once. 3. Ship several packages from one repo — keep the shared Python module in a single project, emit one Two gotchas
Refs:
|
Uh oh!
There was an error while loading. Please reload this page.
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I'm developing tool plugins for our internal systems.
While some logic shared across systems, credentials are separated, so each system should have an individual plugin.
Maintaining these plugins is a hard work, so I started seeking some simplify way.
I noticed that in
manifest.yamlthepluginshas array subfields for providers.So I tried give it more than one element. but didn't work.
Only the last provider installed.
After some digging, I found that
dify-plugin-daemontake only a element from the list: pkg/plugin_packager/decoder/helper.go.Which side shows current design intent? One plugin to only single provider, or multi providers?
2. Additional context or comments
dify:
1.15.0dify-plugin-daemon:
0.6.3All reactions