mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-26 13:18:34 +07:00
Merge branch 'main' into fix/brand
This commit is contained in:
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
._DS_Store
|
||||
.DS_Store
|
||||
.venv
|
||||
plugin_dev_zh_*
|
||||
plugin_dev_ja_*
|
||||
plugin_dev_en_*
|
||||
/tool
|
||||
141
docs.json
141
docs.json
@@ -176,7 +176,8 @@
|
||||
},
|
||||
{
|
||||
"group": "Publishing",
|
||||
"pages": [ {
|
||||
"pages": [
|
||||
{
|
||||
"group": "Publish as a Single-page Web App",
|
||||
"pages": [
|
||||
"en/guides/application-publishing/launch-your-webapp-quickly/README",
|
||||
@@ -272,7 +273,6 @@
|
||||
"en/workshop/intermediate/article-reader",
|
||||
"en/workshop/intermediate/customer-service-bot",
|
||||
"en/workshop/intermediate/twitter-chatflow"
|
||||
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -502,6 +502,7 @@
|
||||
"plugin_dev_en/0221-initialize-development-tools.en",
|
||||
"plugin_dev_en/0222-creating-new-model-provider-extra.en",
|
||||
"plugin_dev_en/0222-creating-new-model-provider.en",
|
||||
"plugin_dev_en/0222-debugging-logs.en",
|
||||
"plugin_dev_en/0222-tool-plugin.en"
|
||||
]
|
||||
}
|
||||
@@ -514,12 +515,14 @@
|
||||
"group": "Code of Conduct & Standards",
|
||||
"pages": [
|
||||
"plugin_dev_en/0312-contributor-covenant-code-of-conduct.en",
|
||||
"plugin_dev_en/0312-privacy-protection-guidelines.en"
|
||||
"plugin_dev_en/0312-privacy-protection-guidelines.en",
|
||||
"plugin_dev_en/0312-third-party-signature-verification.en"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Publishing & Listing",
|
||||
"pages": [
|
||||
"plugin_dev_en/0321-plugin-auto-publish-pr.en",
|
||||
"plugin_dev_en/0321-release-overview.en",
|
||||
"plugin_dev_en/0322-release-by-file.en",
|
||||
"plugin_dev_en/0322-release-to-dify-marketplace.en",
|
||||
@@ -540,6 +543,7 @@
|
||||
{
|
||||
"group": "Development Examples",
|
||||
"pages": [
|
||||
"plugin_dev_en/0431-example-overview-and-index.en",
|
||||
"plugin_dev_en/0432-develop-a-slack-bot-plugin.en",
|
||||
"plugin_dev_en/0432-endpoint.en"
|
||||
]
|
||||
@@ -1127,6 +1131,7 @@
|
||||
"plugin_dev_zh/0221-initialize-development-tools.zh",
|
||||
"plugin_dev_zh/0222-creating-new-model-provider-extra.zh",
|
||||
"plugin_dev_zh/0222-creating-new-model-provider.zh",
|
||||
"plugin_dev_zh/0222-debugging-logs.zh",
|
||||
"plugin_dev_zh/0222-tool-plugin.zh"
|
||||
]
|
||||
}
|
||||
@@ -1139,12 +1144,14 @@
|
||||
"group": "行为准则与规范",
|
||||
"pages": [
|
||||
"plugin_dev_zh/0312-contributor-covenant-code-of-conduct.zh",
|
||||
"plugin_dev_zh/0312-privacy-protection-guidelines.zh"
|
||||
"plugin_dev_zh/0312-privacy-protection-guidelines.zh",
|
||||
"plugin_dev_zh/0312-third-party-signature-verification.zh"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "发布与上架",
|
||||
"pages": [
|
||||
"plugin_dev_zh/0321-plugin-auto-publish-pr.zh",
|
||||
"plugin_dev_zh/0321-release-overview.zh",
|
||||
"plugin_dev_zh/0322-release-by-file.zh",
|
||||
"plugin_dev_zh/0322-release-to-dify-marketplace.zh",
|
||||
@@ -1165,6 +1172,7 @@
|
||||
{
|
||||
"group": "开发示例",
|
||||
"pages": [
|
||||
"plugin_dev_zh/0431-example-overview-and-index.zh",
|
||||
"plugin_dev_zh/0432-develop-a-slack-bot-plugin.zh",
|
||||
"plugin_dev_zh/0432-endpoint.zh"
|
||||
]
|
||||
@@ -1683,6 +1691,131 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tab": "プラグイン開発",
|
||||
"groups": [
|
||||
{
|
||||
"group": "概念と概要",
|
||||
"pages": [
|
||||
{
|
||||
"group": "概要",
|
||||
"pages": [
|
||||
"plugin_dev_ja/0111-getting-started-dify-plugin.ja"
|
||||
]
|
||||
},
|
||||
"plugin_dev_ja/0131-cheatsheet.ja"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "開発実践",
|
||||
"pages": [
|
||||
{
|
||||
"group": "クイックスタート",
|
||||
"pages": [
|
||||
"plugin_dev_ja/0211-getting-started-by-prompt.ja",
|
||||
"plugin_dev_ja/0211-getting-started-dify-tool.ja",
|
||||
"plugin_dev_ja/0211-getting-started-new-model.ja"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Difyプラグインの開発",
|
||||
"pages": [
|
||||
"plugin_dev_ja/0221-initialize-development-tools.ja",
|
||||
"plugin_dev_ja/0222-creating-new-model-provider-extra.ja",
|
||||
"plugin_dev_ja/0222-creating-new-model-provider.ja",
|
||||
"plugin_dev_ja/0222-debugging-logs.ja",
|
||||
"plugin_dev_ja/0222-tool-plugin.ja"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "貢献と公開",
|
||||
"pages": [
|
||||
{
|
||||
"group": "行動規範と基準",
|
||||
"pages": [
|
||||
"plugin_dev_ja/0312-contributor-covenant-code-of-conduct.ja",
|
||||
"plugin_dev_ja/0312-privacy-protection-guidelines.ja",
|
||||
"plugin_dev_ja/0312-third-party-signature-verification.ja"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "公開と掲載",
|
||||
"pages": [
|
||||
"plugin_dev_ja/0321-plugin-auto-publish-pr.ja",
|
||||
"plugin_dev_ja/0321-release-overview.ja",
|
||||
"plugin_dev_ja/0322-release-by-file.ja",
|
||||
"plugin_dev_ja/0322-release-to-dify-marketplace.ja",
|
||||
"plugin_dev_ja/0322-release-to-individual-github-repo.ja"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "よくある質問 (FAQ)",
|
||||
"pages": [
|
||||
"plugin_dev_ja/0331-faq.ja"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "実践例とユースケース",
|
||||
"pages": [
|
||||
{
|
||||
"group": "開発例",
|
||||
"pages": [
|
||||
"plugin_dev_ja/0431-example-overview-and-index.ja",
|
||||
"plugin_dev_ja/0432-develop-a-slack-bot-plugin.ja",
|
||||
"plugin_dev_ja/0432-endpoint.ja"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "高度な開発",
|
||||
"pages": [
|
||||
{
|
||||
"group": "Extension と Agent",
|
||||
"pages": [
|
||||
"plugin_dev_ja/9231-extension-plugin.ja",
|
||||
"plugin_dev_ja/9232-agent.ja",
|
||||
"plugin_dev_ja/9433-agent-strategy-plugin.ja"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "リバースコール",
|
||||
"pages": [
|
||||
"plugin_dev_ja/9241-bundle.ja",
|
||||
"plugin_dev_ja/9241-reverse-invocation.ja",
|
||||
"plugin_dev_ja/9242-reverse-invocation-app.ja",
|
||||
"plugin_dev_ja/9242-reverse-invocation-model.ja",
|
||||
"plugin_dev_ja/9242-reverse-invocation-tool.ja",
|
||||
"plugin_dev_ja/9243-customizable-model.ja",
|
||||
"plugin_dev_ja/9243-reverse-invocation-node.ja"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "リファレンスと仕様",
|
||||
"pages": [
|
||||
{
|
||||
"group": "コア仕様と機能",
|
||||
"pages": [
|
||||
"plugin_dev_ja/0411-general-specifications.ja",
|
||||
"plugin_dev_ja/0411-model-designing-rules.ja",
|
||||
"plugin_dev_ja/0411-model-plugin-introduction.ja",
|
||||
"plugin_dev_ja/0411-persistent-storage-kv.ja",
|
||||
"plugin_dev_ja/0411-plugin-info-by-manifest.ja",
|
||||
"plugin_dev_ja/0411-remote-debug-a-plugin.ja",
|
||||
"plugin_dev_ja/0411-tool.ja",
|
||||
"plugin_dev_ja/0412-model-schema.ja"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tab": "用語ベース",
|
||||
"pages": [
|
||||
|
||||
@@ -303,7 +303,7 @@ In `llm.py`, create a Xinference LLM class, which we will name `XinferenceAILarg
|
||||
"""
|
||||
```
|
||||
|
||||
For an explanation of interface methods, see: [Interfaces](https://github.com/langgenius/dify/blob/main/api/core/model\_runtime/docs/en\_US/interfaces). For specific implementations, refer to: [llm.py](https://github.com/langgenius/dify-runtime/blob/main/lib/model\_providers/anthropic/llm/llm.py).
|
||||
For an explanation of interface methods, see: [Interfaces](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/interfaces.md). For specific implementations, refer to: [llm.py](https://github.com/langgenius/dify-official-plugins/blob/main/models/anthropic/models/llm/llm.py).
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
|
||||
@@ -172,7 +172,7 @@ Create an Anthropic LLM class in `llm.py`, which we will name `AnthropicLargeLan
|
||||
"""
|
||||
```
|
||||
|
||||
For interface method descriptions, see: [Interfaces](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/interfaces), and for specific implementation, refer to: [llm.py](https://github.com/langgenius/dify-runtime/blob/main/lib/model_providers/anthropic/llm/llm.py).
|
||||
For interface method descriptions, see: [Interfaces](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/interfaces), and for specific implementation, refer to: [llm.py](https://github.com/langgenius/dify-official-plugins/blob/main/models/anthropic/models/llm/llm.py).
|
||||
|
||||
#### Provider
|
||||
|
||||
|
||||
@@ -844,3 +844,26 @@ and together, we may step into the AX era of:
|
||||
This document is just a small experiment — a seed of possibility.
|
||||
May it quietly take root, and gently begin to sprout
|
||||
in a future where **humans and AI coexist in harmony**.
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/en/learn-more/use-cases/build-ai-sales-avatar.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20-ai-sales-ava&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fen/learn-more/use-cases%2Fbuild-ai-sales-avatar.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Best Practice
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0431-example-overview-and-index.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0431-example-overview-and-index.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
For more comprehensive best practices on developing plugins with advanced functionality, please refer to the extended plugin development guidelines.
|
||||
|
||||
<Card title="Develop a Slack Bot Plugin" icon="link" href="./develop-a-slack-bot-plugin">
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Develop a Slack Bot Plugin
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0432-develop-a-slack-bot-plugin.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0432-develop-a-slack-bot-plugin.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
**What You’ll Learn:**
|
||||
|
||||
Gain a solid understanding of how to build a Slack Bot that’s powered by AI—one that can respond to user questions right inside Slack.
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Outputting Logs for Plugins Development and Debugging
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0222-debugging-logs.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0222-debugging-logs.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
As a plugin developer, you may want to print arbitrary strings to logs during plugin processing for development or debugging purposes.
|
||||
|
||||
For this purpose, the plugin SDK implements a handler for Python's standard `logging` library. By using this, you can output any string to both the **standard output during remote debugging** and the **plugin daemon container logs** (community edition only).
|
||||
@@ -37,3 +55,26 @@ class LoggerDemoTool(Tool):
|
||||
|
||||
yield self.create_text_message("Hello, Dify!")
|
||||
```
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/en/plugins/best-practice/how-to-print-strings-to-logs-for-debugging.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20o-print-strings-to-logs-for-debugg&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fen/plugins/best-practice%2Fhow-to-print-strings-to-logs-for-debugging.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -3,6 +3,24 @@ title: FAQ
|
||||
description: 'Author: Allen'
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0331-faq.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0331-faq.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
## How to handle plugin upload failure during installation?
|
||||
|
||||
**Error Details**: The error message shows `PluginDaemonBadRequestError: plugin_unique_identifier is not valid`.
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Publish Plugins
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0321-release-overview.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0321-release-overview.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
### Publish Methods
|
||||
|
||||
To accommodate the various publishing needs of developers, Dify provides three plugin publish methods:
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Package the Plugin File and Publish it
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0322-release-by-file.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0322-release-by-file.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
After completing plugin development, you can package your plugin project as a local file and share it with others. Once the plugin file is obtained, it can be installed into a Dify Workspace. This guide will show you how to package a plugin project as a local file and how to install plugins using local files.
|
||||
|
||||
### **Prerequisites**
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: "Automatically Publish Plugins via PR"
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0321-plugin-auto-publish-pr.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0321-plugin-auto-publish-pr.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
### Background
|
||||
|
||||
Updating plugins that others are actively using can be tedious. Traditionally, you would need to modify code, bump versions, push changes, create branches, package files, and submit PRs manually - a repetitive process that slows down development.
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Publish to Your Personal GitHub Repository
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0322-release-to-individual-github-repo.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0322-release-to-individual-github-repo.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
You can install plugins through GitHub repository links. After developing a plugin, you can choose to publish it to a public GitHub repository for others to download and use. This method offers the following advantages:
|
||||
|
||||
• **Personal Management**: Complete control over plugin code and updates
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Introduction
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0322-release-to-dify-marketplace.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0322-release-to-dify-marketplace.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
**Dify Marketplace** welcomes plugin submission requests from both partners and community developers. Your contributions will broaden the scope of possibilities for Dify plugins. This guide provides clear publishing procedures and best-practice recommendations to help you successfully release your plugin and create value for the community.
|
||||
|
||||
Follow these steps to submit your plugin as a Pull Request (PR) in the [GitHub repository](https://github.com/langgenius/dify-plugins) for review. Once approved, your plugin will officially launch on the Dify Marketplace.
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Plugin Developer Guidelines
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0312-contributor-covenant-code-of-conduct.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0312-contributor-covenant-code-of-conduct.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
### Before Submitting a Pull Request (PR)
|
||||
|
||||
1. **Check Plugin's Functionality and Complete Documentation**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Plugin Privacy Protection Guidelines
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0312-privacy-protection-guidelines.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0312-privacy-protection-guidelines.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
When you are submitting your Plugin to Dify Marketplace, you are required to be transparent in how you handle user data. The following guidelines focus on how to address privacy-related questions and user data processing for your plugin.
|
||||
|
||||
Center your privacy policy around the following points:
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Signing Plugins for Third-Party Signature Verification
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0312-third-party-signature-verification.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0312-third-party-signature-verification.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
<Warning>This feature is available only in the Dify Community Edition. Third-party signature verification is not currently supported on Dify Cloud Edition.</Warning>
|
||||
|
||||
Third-party signature verification allows Dify administrators to safely approve the installation of plugins not listed on the Dify Marketplace without completely disabling signature verification. This supports the following scenarios for example:
|
||||
|
||||
@@ -5,6 +5,24 @@ title: Debug Plugin
|
||||
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0411-remote-debug-a-plugin.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0411-remote-debug-a-plugin.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Once plugin development is complete, the next step is to test whether the plugin runs correctly. Dify provides remote debugging method.
|
||||
|
||||
Go to ["Plugin"](https://cloud.dify.ai/plugins) page to get the debugging key and remote URL.
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Develop Plugins
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0111-getting-started-dify-plugin.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0111-getting-started-dify-plugin.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
### **Quick Start**
|
||||
|
||||
You can quickly understand how to develop different types of plugins and master the functional components involved in plugin development through these development examples:
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Agent Strategy Plugin
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9433-agent-strategy-plugin.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9433-agent-strategy-plugin.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
An **Agent Strategy Plugin** helps an LLM carry out tasks like reasoning or decision-making, including choosing and calling tools, as well as handling results. This allows the system to address problems more autonomously.
|
||||
|
||||
Below, you'll see how to develop a plugin that supports **Function Calling** to automatically fetch the current time.
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Bundle
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9241-bundle.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9241-bundle.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
A Bundle plugin package is a collection of multiple plugins. It can package multiple plugins into one plugin to achieve batch installation effects while providing more powerful services.
|
||||
|
||||
You can package multiple plugins into a Bundle using the Dify CLI tool. Bundle plugin packages offer three types:
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Extension Plugin
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9231-extension-plugin.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9231-extension-plugin.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
This guide will help you quickly develop an Extension type plugin and understand the basic plugin development process.
|
||||
|
||||
### **Prerequisites**
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Install Development Tools
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0221-initialize-development-tools.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0221-initialize-development-tools.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Before start to develop Dify plugins, please prepare the following prerequisites:
|
||||
* [Dify Plugin CLI tool](https://github.com/langgenius/dify-plugin-daemon?tab=readme-ov-file#cli)
|
||||
* [Python 3.12+](https://docs.python.org/3.12/using/index.html)
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Model Plugin
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0411-model-plugin-introduction.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0411-model-plugin-introduction.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Model type plugins enable the Dify platform to request models from specific model providers. For example, after installing the OpenAI model plugin, the Dify platform can request models like GPT-4, GPT-4o-2024-05-13, etc., provided by OpenAI.
|
||||
|
||||
### **Model Plugin Structure**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Create Model Providers
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0222-creating-new-model-provider.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0222-creating-new-model-provider.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Creating a Model Type Plugin The first step in creating a Model type plugin is to initialize the plugin project and create the model provider file, followed by integrating specific predefined/custom models.
|
||||
|
||||
### **Prerequisites**
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Integrate the Customizable Model
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9243-customizable-model.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9243-customizable-model.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
A **custom model** refers to an LLM that you deploy or configure on your own. This document uses the [Xinference model](https://inference.readthedocs.io/en/latest/) as an example to demonstrate how to integrate a custom model into your **model plugin**.
|
||||
|
||||
By default, a custom model automatically includes two parameters—its **model type** and **model name**—and does not require additional definitions in the provider YAML file.
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Integrate the Predefined Model
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0222-creating-new-model-provider-extra.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0222-creating-new-model-provider-extra.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Before accessing a predefined model, make sure you have created a [model provider](/en/plugins/quick-start/develop-plugins/model-plugin/create-model-providers). Accessing predefined models is roughly divided into the following steps:
|
||||
|
||||
1. **Create Module Structures by Model Type**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Tool Plugin
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0222-tool-plugin.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0222-tool-plugin.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Tool type plugins are external tools that can be referenced by Chatflow / Workflow / Agent application types to enhance the capabilities of Dify applications. For example, adding online search capabilities, image generation capabilities, etc. to an application. Tool Type Plugins provide a complete set of tools and API implementations.
|
||||
|
||||

|
||||
|
||||
@@ -3,6 +3,24 @@ title: Agent
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9232-agent.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9232-agent.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
**Agent Strategy Overview**
|
||||
|
||||
An Agent Strategy is an extensible template that defines standard input content and output formats. By developing specific Agent strategy interface functionality, you can implement various Agent strategies such as CoT (Chain of Thought) / ToT (Tree of Thought) / GoT (Graph of Thought) / BoT (Backbone of Thought), and achieve complex strategies like [Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/overview/).
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Endpoint
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0432-endpoint.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0432-endpoint.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
In this article, we will use the [Quick Start: Rainbow Cat project](../quick-start/develop-plugins/extension-plugin) as an example to illustrate the structure of Endpoint within the plugin. For the complete plugin code, please refer to the [Github repository](https://github.com/langgenius/dify-plugin-sdks/tree/main/python/examples/neko).
|
||||
|
||||
### **Group Definition**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: General Specifications
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0411-general-specifications.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0411-general-specifications.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
This article will briefly introduce common structures in plugin development.
|
||||
|
||||
### **Path Specifications**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Manifest
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0411-plugin-info-by-manifest.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0411-plugin-info-by-manifest.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
**Manifest File** A Manifest is a YAML-compliant file that defines the most basic information about a **plugin**, including but not limited to the plugin name, author, included tools, models, and other information.
|
||||
|
||||
If this file's format is incorrect, both the plugin parsing and packaging processes will fail.
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Model Designing Rules
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0411-model-designing-rules.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0411-model-designing-rules.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
* Model provider rules are based on the [Provider](/en/plugins/schema-definition/model/model-designing-rules#provider) entity.
|
||||
* Model rules are based on the [AIModelEntity](/en/plugins/schema-definition/model/model-designing-rules#provider) entity.
|
||||
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Model Schema
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0412-model-schema.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0412-model-schema.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
The endpoint methods and parameter descriptions that need to be implemented by the supplier and each model type are described here.
|
||||
|
||||
### Model Providers
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Persistent Storage
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0411-persistent-storage-kv.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0411-persistent-storage-kv.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
If you look at the Tool and Endpoint in the plug-in alone, it is not difficult to find that in most cases it can only complete a single round of interaction, the request returns the data, and the task ends.
|
||||
|
||||
If there is a need for long-term storage of data, such as the implementation of persistent memory, the plug-in needs to have persistent storage capabilities. **Persistent storage mechanism allows plugins to have the ability to store data persistently in the same Workspace** , currently through the provision of KV database to meet the storage needs , the future may be based on the actual use of the introduction of more flexible and more powerful storage endpoints .
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Reverse Invocation of the Dify Service
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9241-reverse-invocation.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9241-reverse-invocation.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Plugins can request some of the services within the main Dify platform to enhance it's capabilities by reverse invocation.
|
||||
|
||||
### Callable Dify Modules
|
||||
|
||||
@@ -3,6 +3,24 @@ title: App
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9242-reverse-invocation-app.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9242-reverse-invocation-app.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Reverse App requesting means plugins can access App data in Dify. This module supports both streaming and non-streaming App calls.
|
||||
|
||||
### **Endpoints Type:**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Model
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9242-reverse-invocation-model.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9242-reverse-invocation-model.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Reverse Model Request refers to the plugin's ability to make reverse requests to LLM capabilities within Dify, including all model types and features on the platform, such as TTS, Rerank, etc.
|
||||
|
||||
Note that requesting models requires passing a ModelConfig type parameter. Its structure can be referenced in Common Specification Definitions, and this structure will have slight differences for different types of models.
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Node
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9243-reverse-invocation-node.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9243-reverse-invocation-node.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Reverse Node Request refers to the plugin's ability to access certain nodes within Dify's Chatflow/Workflow applications.
|
||||
|
||||
The `ParameterExtractor` and `QuestionClassifier` nodes in `Workflow` encapsulate complex Prompt and code logic that can accomplish many tasks that are difficult to solve with hard coding through LLM. Plugins can request these two nodes.
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Tool
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/9242-reverse-invocation-tool.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/9242-reverse-invocation-tool.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
When encountering the following scenarios:
|
||||
|
||||
* A tool-type plugin has implemented a feature but hasn't met expectations and needs data reprocessing
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Tool
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
CONTRIBUTOR NOTE:
|
||||
----------------
|
||||
This is a legacy document that is being deprecated.
|
||||
Please DO NOT make changes to this version.
|
||||
All updates should be directed to the new version at:
|
||||
/plugin_dev_en/0411-tool.en
|
||||
*/}
|
||||
|
||||
<Card title="This Documentation is Being Deprecated" icon="circle-exclamation" href="/plugin_dev_en/0411-tool.en">
|
||||
<p>This page is being phased out as part of our documentation reorganization.</p>
|
||||
|
||||
<p><strong>Click this card</strong> to be redirected to the updated version with the most current information.</p>
|
||||
|
||||
<p>If you notice any discrepancies or areas needing improvement in the new documentation, please use the "Report an issue" button at the bottom of the page.</p>
|
||||
</Card>
|
||||
|
||||
Before reading the detailed interface documentation, make sure you have read [Quick start: Tools](../quick-start/develop-plugins/tool-plugin) and have a general understanding of the Dify plugin's tool access process.
|
||||
|
||||
### **Data Structures**
|
||||
|
||||
@@ -110,4 +110,27 @@ Where You Can Use It
|
||||
- Do not imply endorsement, certification, or official partnership with Dify
|
||||
- Do not use the badge in commercial marketing, paid training, or monetized courses without prior written permission
|
||||
|
||||
[Download design kit](https://assets-docs.dify.ai/2025/05/5f547d3718bf32067849d9a83d9c92cf.zip)
|
||||
[Download Dify Design Kit](https://assets-docs.dify.ai/2025/05/5f547d3718bf32067849d9a83d9c92cf.zip)
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/en/resources/about-dify/dify-brand-guidelines.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20brand-guideli&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fen/resources/about-dify%2Fdify-brand-guidelines.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -103,3 +103,26 @@ Latest Version: 2025/03/04
|
||||
|
||||
---
|
||||
© LangGenius, Inc. All rights reserved. Unauthorized use of Dify Brand Assets is strictly prohibited.
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/en/resources/about-dify/dify-brand-usage-terms.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20brand-usage-te&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fen/resources/about-dify%2Fdify-brand-usage-terms.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -199,14 +199,14 @@ It will be automatically generated by the script.
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/en/termbase/termbase.mdx"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/en/resources/termbase.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fen/termbase%2Ftermbase.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fen/resources%2Ftermbase.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
|
||||
@@ -300,7 +300,7 @@ provider_credential_schema:
|
||||
"""
|
||||
```
|
||||
|
||||
インターフェース方法の詳細については:[インターフェース](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/interfaces)をご覧ください。具体的な実装例については、[llm.py](https://github.com/langgenius/dify-runtime/blob/main/lib/model_providers/anthropic/llm/llm.py)を参照してください。
|
||||
インターフェース方法の詳細については:[インターフェース](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/interfaces)をご覧ください。具体的な実装例については、[llm.py](https://github.com/langgenius/dify-official-plugins/blob/main/models/anthropic/models/llm/llm.py)を参照してください。
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
|
||||
@@ -224,7 +224,7 @@ class XinferenceProvider(Provider):
|
||||
|
||||
供給業者がカスタムLLMを追加することをサポートしている場合、このメソッドを実装してカスタムモデルがモデル規則を取得できるようにすることができます。デフォルトではNoneを返します。
|
||||
|
||||
ほとんどの微調整モデルは`OpenAI`供給業者の下で、微調整モデル名を使用してベースモデルを取得できます。例えば、`gpt-3.5-turbo-1106`のような微調整モデル名を使用して、基本モデルの事前定義されたパラメータルールを取得できます。具体的な実装については、[openai](https://github.com/langgenius/dify-runtime/blob/main/lib/model_providers/anthropic/llm/llm.py)を参照してください。
|
||||
ほとんどの微調整モデルは`OpenAI`供給業者の下で、微調整モデル名を使用してベースモデルを取得できます。例えば、`gpt-3.5-turbo-1106`のような微調整モデル名を使用して、基本モデルの事前定義されたパラメータルールを取得できます。具体的な実装については、[openai](https://github.com/langgenius/dify-official-plugins/blob/main/models/anthropic/models/llm/llm.py)を参照してください。
|
||||
|
||||
### TextEmbedding
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ pricing: # 価格情報
|
||||
"""
|
||||
```
|
||||
|
||||
インターフェースメソッドの説明については:[Interfaces](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/interfaces)をご覧ください。具体的な実装については:[llm.py](https://github.com/langgenius/dify-runtime/blob/main/lib/model_providers/anthropic/llm/llm.py)を参照してください。
|
||||
インターフェースメソッドの説明については:[Interfaces](https://github.com/langgenius/dify/blob/main/api/core/model_runtime/docs/en_US/interfaces.md)をご覧ください。具体的な実装については:[llm.py](https://github.com/langgenius/dify-official-plugins/blob/main/models/anthropic/models/llm/llm.py)を参照してください。
|
||||
|
||||
[^1]: #### プロバイダー
|
||||
|
||||
|
||||
@@ -856,3 +856,26 @@ Agent PF(プラットフォーム)の機能をさらにモジュール化し
|
||||
この文書を小さな試みと記録として書き記します。
|
||||
それが小さな種となり、
|
||||
人とAIが調和して共生する未来で、**静かに根付き、ゆっくりと芽を出しますように**。
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="このページを編集する"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/ja-jp/learn-more/use-cases/build-ai-sales-avatar.mdx"
|
||||
>
|
||||
直接貢献することでドキュメントの改善にご協力ください
|
||||
</Card>
|
||||
<Card
|
||||
title="問題を報告する"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=ドキュメントの問題%3A%20-ai-sales-ava&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fja-jp/learn-more/use-cases%2Fbuild-ai-sales-avatar.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E"
|
||||
>
|
||||
エラーを見つけたり提案がありますか?お知らせください
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -3,6 +3,24 @@ title: ベストプラクティス
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0431-example-overview-and-index.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0431-example-overview-and-index.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
高度な機能を持つプラグイン開発に関する、より詳しいベストプラクティスは、拡張プラグイン開発ガイドラインをご覧ください。
|
||||
|
||||
<Card title="develop-a-slack-bot-plugin.md" icon="link" href="develop-a-slack-bot-plugin.md">
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Slack ボットプラグインの開発
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0432-develop-a-slack-bot-plugin.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0432-develop-a-slack-bot-plugin.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
**この記事では、以下の内容を理解できます。**
|
||||
|
||||
Slack Bot の構築方法を深く理解し、AI を活用した Slack チャットボットを作成して、Slack プラットフォーム上でユーザーの質問にインテリジェントに応答する方法を学びます。
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: 開発やデバッグのためのログの出力
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0222-debugging-logs.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0222-debugging-logs.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
プラグインの開発者は、開発やデバッグの目的で、プラグインの処理の過程で任意の文字列をログに出力したいと考えることがあるでしょう。
|
||||
|
||||
この目的で、プラグインの SDK には、Python の標準ライブラリである `logging` 用のハンドラが実装されています。これを利用すれば、**リモートデバッグ中の標準出力** にも **プラグインデーモンのコンテナログ**(コミュニティ版のみ)にも、任意の文字列を出力できます。
|
||||
@@ -37,3 +55,26 @@ class LoggerDemoTool(Tool):
|
||||
|
||||
yield self.create_text_message("Hello, Dify!")
|
||||
```
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="このページを編集する"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/ja-jp/plugins/best-practice/how-to-print-strings-to-logs-for-debugging.mdx"
|
||||
>
|
||||
直接貢献することでドキュメントの改善にご協力ください
|
||||
</Card>
|
||||
<Card
|
||||
title="問題を報告する"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=ドキュメントの問題%3A%20o-print-strings-to-logs-for-debugg&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fja-jp/plugins/best-practice%2Fhow-to-print-strings-to-logs-for-debugging.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E"
|
||||
>
|
||||
エラーを見つけたり提案がありますか?お知らせください
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -3,6 +3,24 @@ title: よくある質問
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0331-faq.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0331-faq.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
## プラグインのインストール時にアップロードが失敗する場合の対処方法は?
|
||||
|
||||
**エラー詳細**:`PluginDaemonBadRequestError: plugin_unique_identifier is not valid` というエラーメッセージが表示されます。
|
||||
|
||||
@@ -3,6 +3,24 @@ title: プラグインの公開
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0321-release-overview.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0321-release-overview.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
## 公開方法
|
||||
|
||||
異なる開発者のニーズに対応するため、Difyでは以下の3つのプラグイン公開方法を提供しています:
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: ローカルでの公開と共有
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0322-release-by-file.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0322-release-by-file.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
プラグイン開発完了後、プラグインプロジェクトをローカルファイルとしてパッケージ化し、他のユーザーと共有することができます。プラグインファイルを使用してDify Workspaceにインストールすることが可能です。
|
||||
|
||||
* **特徴:**
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: "PRを通じてプラグインを自動的に公開する"
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0321-plugin-auto-publish-pr.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0321-plugin-auto-publish-pr.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
### 背景
|
||||
|
||||
プラグイン貢献者が**他のユーザーにすでに使用されているDifyプラグイン**を更新する必要がある場合、そのプロセスは非常に煩雑です:貢献者はまずプラグインのソースコードを修正してバージョン番号を更新し、変更をプラグインソースリポジトリにプッシュし、フォークしたdify-pluginリポジトリに新しいブランチを作成する必要があります。その後、プラグインを手動でパッケージ化し、パッケージファイルをアップロードし、元のdify-pluginリポジトリにマージするためのPRを作成する必要があります。このプロセスはプラグインコードが変更されるたびに繰り返す必要があり、時間がかかり非効率的です。
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: 個人GitHubリポジトリへの公開
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0322-release-to-individual-github-repo.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0322-release-to-individual-github-repo.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
GitHubリポジトリリンクを通じたプラグインのインストールに対応しています。プラグイン開発完了後、公開GitHubリポジトリにプラグインを公開して、他のユーザーがダウンロードして使用できるようにすることができます。この方法には以下の利点があります:
|
||||
|
||||
* 個人管理:プラグインのコードとアップデートを完全にコントロール可能
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Dify Marketplaceへの公開
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0322-release-to-dify-marketplace.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0322-release-to-dify-marketplace.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
Dify Marketplaceは、Difyプラットフォームを利用する世界中のユーザーにより強力で柔軟な機能拡張を提供することを目指しています。皆様の貢献は、このプラットフォームの可能性をさらに広げることにつながります。
|
||||
|
||||
* **特徴:**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: プラグイン開発者ガイドライン
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0312-contributor-covenant-code-of-conduct.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0312-contributor-covenant-code-of-conduct.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
### プルリクエスト(PR)を提出する前に
|
||||
|
||||
1. **プラグインの機能とドキュメントの完全性を確認する**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: プラグインのプライバシー保護に関するガイドライン
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0312-privacy-protection-guidelines.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0312-privacy-protection-guidelines.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
Dify Marketplaceにプラグインを提出する際には、ユーザーデータの取り扱いについて透明性を確保する必要があります。以下のガイドラインでは、プラグインに関するプライバシー関連の質問や、ユーザーデータ処理にどのように対応すべきかを重点的に説明します。
|
||||
|
||||
プライバシーポリシーは、以下の点を中心に構成してください。
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: 第三者署名検証のためにプラグインに署名する
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0312-third-party-signature-verification.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0312-third-party-signature-verification.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
<Warning>この機能はコミュニティ版でのみ利用できます。クラウドサービスでは、現時点では第三者署名検証はサポートされていません。</Warning>
|
||||
|
||||
第三者署名検証により、Dify の管理者は、Dify Marketplace にリストされていないプラグインのインストールを、署名の検証を完全に無効化することなく、安全に許可できるようになります。これにより、例えば次のようなシナリオがサポートされます。
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: プラグインのデバッグ方法
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0411-remote-debug-a-plugin.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0411-remote-debug-a-plugin.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
プラグインの開発が完了したら、次は正常に動作するかどうかをテストしましょう。Difyはリモートデバッグ機能を提供しており、「プラグイン管理」ページでデバッグキーとリモートサーバーアドレスを取得できます。
|
||||
|
||||
リモートサーバーのアドレスとデバッグキーは、[「プラグイン管理」](https://cloud.dify.ai/plugins)ページにアクセスすることで取得できます。
|
||||
|
||||
@@ -3,6 +3,24 @@ title: プラグイン開発ガイド
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0111-getting-started-dify-plugin.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0111-getting-started-dify-plugin.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
### はじめに
|
||||
|
||||
このガイドでは、ツール型プラグインやモデルプラグインなど、様々な種類の**プラグインの開発方法を例**を挙げて説明します。これにより、プラグイン開発における様々な機能の組み合わせを迅速に理解し、活用できるようになります。開発を始める前には、まず開発環境を用意し、必要なフレームワークをインストールして初期設定を行ってください。詳細は以下を参照してください:
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: エージェント戦略プラグイン
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9433-agent-strategy-plugin.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9433-agent-strategy-plugin.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
エージェント戦略プラグインは、LLMが推論や意思決定ロジックを実行するのを支援します。具体的には、ツール選択、呼び出し、結果処理といった一連の動作をより自動化された方法で実行し、問題を解決します。
|
||||
|
||||
この記事では、ツール呼び出し(Function Calling)機能を備え、現在の正確な時刻を自動的に取得するプラグインの作成方法を説明します。
|
||||
|
||||
@@ -3,6 +3,24 @@ title: バンドル
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9241-bundle.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9241-bundle.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
バンドルプラグインパッケージは、複数のプラグインをまとめたものです。複数のプラグインを一つのパッケージにまとめることで、プラグインの一括インストールを可能にし、より高度な機能を提供します。
|
||||
|
||||
Dify CLIツールを使用すると、複数のプラグインをバンドルとしてパッケージ化できます。バンドルプラグインパッケージには、以下の3つのタイプがあります。
|
||||
|
||||
@@ -3,6 +3,24 @@ title: 拡張機能型プラグイン
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9231-extension-plugin.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9231-extension-plugin.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
このドキュメントでは、Extensionタイプのプラグインを迅速に開発し、プラグイン開発の基本的な流れを理解するのに役立つように解説します。
|
||||
|
||||
### 事前準備
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: 開発環境のセットアップ
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0221-initialize-development-tools.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0221-initialize-development-tools.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
Difyプラグインの開発を始める前に、以下の前提条件を準備してください:
|
||||
* [DifyプラグインCLIツール](https://github.com/langgenius/dify-plugin-daemon?tab=readme-ov-file#cli)
|
||||
* [Python 3.12+](https://docs.python.org/3.12/using/index.html)
|
||||
|
||||
@@ -3,6 +3,24 @@ title: モデルプラグイン
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0411-model-plugin-introduction.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0411-model-plugin-introduction.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
モデルタイププラグインを導入することで、Difyプラットフォームは特定のモデルプロバイダーが提供するモデルを利用できるようになります。例えば、OpenAIモデルプラグインをインストールすると、DifyプラットフォームからOpenAIのGPT-4やGPT-4o-2024-05-13といったモデルをリクエストできるようになります。
|
||||
|
||||
### **モデルプラグインの構造**
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: モデルプロバイダーの構築
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0222-creating-new-model-provider.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0222-creating-new-model-provider.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
Modelタイプのプラグインを作成する最初のステップは、プラグインプロジェクトを初期化し、モデルプロバイダーファイルを作成することです。その後、具体的な定義済みモデルやカスタムモデルを接続します。
|
||||
|
||||
### 事前準備 <a href="#qian-zhi-zhun-bei" id="qian-zhi-zhun-bei"></a>
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: カスタムモデルの組み込み
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9243-customizable-model.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9243-customizable-model.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
カスタムモデルとは、ユーザー自身でデプロイまたは設定する必要があるLLMのことです。この記事では、[Xinferenceモデル](https://inference.readthedocs.io/en/latest/)を例に、モデルプラグイン内でカスタムモデルを組み込む方法を解説します。
|
||||
|
||||
カスタムモデルには、デフォルトでモデルタイプとモデル名の2つのパラメータが含まれており、サプライヤのyamlファイルで定義する必要はありません。
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: 定義済みモデルの組み込み
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0222-creating-new-model-provider-extra.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0222-creating-new-model-provider-extra.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
[モデルプロバイダーの作成](/ja-jp/plugins/quick-start/develop-plugins/model-plugin/create-model-providers)が完了していることを確認してください。事前定義済みモデルを組み込むには、以下の手順に従います。
|
||||
|
||||
1. **モデルタイプに応じたモジュール構造の作成**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: ツールプラグイン
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0222-tool-plugin.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0222-tool-plugin.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
Tool(ツール)プラグインは、チャットフロー、ワークフロー、エージェントといったアプリタイプから参照できる外部ツールであり、Difyアプリの機能を拡張するために使用されます。例えば、アプリにオンライン検索機能や画像生成機能を追加するといったことが可能です。ツールプラグインは、包括的なツールセットとAPI実装機能を提供します。
|
||||
|
||||
<img
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Agent(エージェント)
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9232-agent.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9232-agent.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
**エージェント戦略の概要**
|
||||
|
||||
エージェント戦略とは、標準的な入力コンテンツと出力形式を定義する拡張可能なテンプレートです。特定のエージェント戦略インターフェースを開発することで、CoT(Chain of Thought:思考の連鎖)、ToT(Tree of Thought:思考の木)、GoT(Graph of Thought:思考のグラフ)、BoT(Backbone of Thought:思考のバックボーン)といった様々なエージェント戦略を実装したり、[Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/overview/) のような複雑な戦略を実現したりできます。
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Endpoint(エンドポイント)
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0432-endpoint.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0432-endpoint.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
この記事では、プラグイン内のエンドポイントの構造を説明するために、[クイックスタート:レインボーキャットプロジェクト](/ja-jp/plugins/quick-start/develop-plugins/extension-plugin)を例として取り上げます。完全なプラグインコードは、[Github](https://github.com/langgenius/dify-plugin-sdks/tree/main/python/examples/neko)で確認できます。
|
||||
|
||||
### **グループの定義**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: 一般的な標準仕様
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0411-general-specifications.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0411-general-specifications.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
本文では、プラグイン開発における共通構造について簡単に説明します。
|
||||
|
||||
### **パス仕様**
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Manifest(マニフェスト)
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0411-plugin-info-by-manifest.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0411-plugin-info-by-manifest.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
**マニフェストファイル** マニフェストファイルとは、**プラグイン**に関する最も基本的な情報を定義するYAML形式のファイルです。プラグイン名、作成者、含まれるツールやモデルなどの情報が含まれます。
|
||||
|
||||
このファイルの形式が正しくないと、プラグインの解析とパッケージング処理は失敗します。
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: モデル設計規則
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0411-model-designing-rules.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0411-model-designing-rules.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
* モデルプロバイダーのルールは、[Provider](/ja-jp/plugins/schema-definition/model/model-designing-rules) エンティティに基づいています。
|
||||
* モデルルールは、[AIModelEntity](/ja-jp/plugins/schema-definition/model/model-designing-rules) エンティティに基づいています。
|
||||
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: モデルスキーマ
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0412-model-schema.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0412-model-schema.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
ここでは、プロバイダーと各モデルタイプが実装する必要があるインターフェースメソッドとパラメータについて説明します。
|
||||
|
||||
# モデルプロバイダー
|
||||
|
||||
@@ -3,6 +3,24 @@ title: 永続化されたストレージ
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0411-persistent-storage-kv.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0411-persistent-storage-kv.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
プラグイン内のToolとEndpointを個別に見ると、ほとんどの場合、単一のラウンドの対話、つまりリクエストを送信してデータを返し、タスクが終了するだけであることがわかります。
|
||||
|
||||
長期的なデータの保存が必要な場合、例えば永続的なメモリを実装する場合、プラグインには永続的なストレージ機能が必要です。**永続ストレージメカニズムにより、プラグインは同じWorkspace内でデータを永続的に保存する機能を持つことができます**。現在はKVデータベースを提供してストレージのニーズを満たしており、将来的には実際の使用状況に基づいて、より柔軟で強力なストレージインターフェースを導入する可能性があります。
|
||||
|
||||
@@ -3,6 +3,24 @@ title: Difyサービスへのバックコール
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9241-reverse-invocation.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9241-reverse-invocation.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
プラグインは、Difyメインプラットフォーム内の特定のサービスを自由に呼び出し、プラグインの機能を拡張できます。
|
||||
|
||||
### 呼び出し可能なDifyモジュール
|
||||
|
||||
@@ -3,6 +3,24 @@ title: アプリ
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9242-reverse-invocation-app.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9242-reverse-invocation-app.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
リバース呼び出しとは、プラグインがDify内のAppデータにアクセスできることを意味します。このモジュールは、ストリーミングと非ストリーミングの両方のAppコールをサポートしています。
|
||||
|
||||
### **エンドポイントタイプ:**
|
||||
|
||||
@@ -3,6 +3,24 @@ title: モデル
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9242-reverse-invocation-model.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9242-reverse-invocation-model.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
リバースモデルリクエストとは、プラグインがDify内のLLM機能に対してリバースリクエストを行う能力を指し、TTS、Rerankなど、プラットフォーム上のすべてのモデルタイプと機能が含まれます。
|
||||
|
||||
モデルのリクエストには、ModelConfigタイプのパラメータを渡す必要があることに注意してください。その構造は共通仕様定義で参照でき、この構造は異なるタイプのモデルで若干の違いがあります。
|
||||
|
||||
@@ -3,6 +3,24 @@ title: ノード
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9243-reverse-invocation-node.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9243-reverse-invocation-node.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
リバースノードリクエストとは、プラグインがDifyのChatflow/Workflowアプリケーション内の特定のノードにアクセスする能力を指します。
|
||||
|
||||
`Workflow`の`ParameterExtractor`と`QuestionClassifier`ノードは、複雑なPromptとコードロジックをカプセル化しており、LLMを通じたハードコーディングでは解決が困難な多くのタスクを実行できます。プラグインはこれら2つのノードをリクエストすることができます。
|
||||
|
||||
@@ -3,6 +3,24 @@ title: ツール
|
||||
---
|
||||
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/9242-reverse-invocation-tool.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/9242-reverse-invocation-tool.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
以下のようなシナリオに遭遇した場合:
|
||||
|
||||
* ツールタイププラグインが機能を実装したが、期待を満たしておらずデータの再処理が必要な場合
|
||||
|
||||
@@ -2,6 +2,24 @@
|
||||
title: Tool(ツール)
|
||||
---
|
||||
|
||||
|
||||
{/*
|
||||
コントリビューター注:
|
||||
----------------
|
||||
これはレガシードキュメントであり、非推奨になります。
|
||||
このバージョンに変更を加えないでください。
|
||||
すべての更新は新しいバージョンに向けられるべきです:
|
||||
/plugin_dev_ja/0411-tool.ja
|
||||
*/}
|
||||
|
||||
<Card title="このドキュメントはまもなく非推奨になります" icon="circle-exclamation" href="/plugin_dev_ja/0411-tool.ja">
|
||||
<p>ドキュメント再編の一環として、このページは段階的に廃止されます。</p>
|
||||
|
||||
<p><u><b>このカードをクリックして</b></u>、最新情報が含まれる更新版にリダイレクトしてください。</p>
|
||||
|
||||
<p>新しいドキュメントに不一致や改善が必要な箇所を見つけた場合は、ページ下部の「問題を報告」ボタンを使用してください。</p>
|
||||
</Card>
|
||||
|
||||
詳細なインターフェースドキュメントを読む前に、[クイックスタート:ツール](/ja-jp/plugins/quick-start/develop-plugins/tool-plugin) を参照し、Difyプラグインにおけるツールの利用プロセスについて、概要を把握しておいてください。
|
||||
|
||||
### **データ構造**
|
||||
|
||||
@@ -87,3 +87,26 @@ Dify パートナーバッジは、Dify との公式な関係を示すために
|
||||
## リソースをダウンロード
|
||||
|
||||
[Dify デザインキットをダウンロード](https://assets-docs.dify.ai/2025/05/5f547d3718bf32067849d9a83d9c92cf.zip)
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="このページを編集する"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/ja-jp/resources/about-dify/dify-brand-guidelines.mdx"
|
||||
>
|
||||
直接貢献することでドキュメントの改善にご協力ください
|
||||
</Card>
|
||||
<Card
|
||||
title="問題を報告する"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=ドキュメントの問題%3A%20brand-guideli&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fja-jp/resources/about-dify%2Fdify-brand-guidelines.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E"
|
||||
>
|
||||
エラーを見つけたり提案がありますか?お知らせください
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -106,3 +106,26 @@ Dify は定期的にこれらのブランド使用規約を更新する場合が
|
||||
|
||||
---
|
||||
© LangGenius, Inc. すべての権利を保有します。Dify ブランドアセットの無断使用は固く禁じられています。
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="このページを編集する"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/ja-jp/resources/about-dify/dify-brand-usage-terms.mdx"
|
||||
>
|
||||
直接貢献することでドキュメントの改善にご協力ください
|
||||
</Card>
|
||||
<Card
|
||||
title="問題を報告する"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=ドキュメントの問題%3A%20brand-usage-te&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fja-jp/resources/about-dify%2Fdify-brand-usage-terms.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E"
|
||||
>
|
||||
エラーを見つけたり提案がありますか?お知らせください
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -199,14 +199,14 @@ It will be automatically generated by the script.
|
||||
<Card
|
||||
title="このページを編集する"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/ja-jp/termbase/termbase.mdx"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/ja-jp/resources/termbase.mdx"
|
||||
>
|
||||
直接貢献することでドキュメントの改善にご協力ください
|
||||
</Card>
|
||||
<Card
|
||||
title="問題を報告する"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=ドキュメントの問題%3A%20&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fja-jp/termbase%2Ftermbase.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=ドキュメントの問題%3A%20&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fja-jp/resources%2Ftermbase.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E"
|
||||
>
|
||||
エラーを見つけたり提案がありますか?お知らせください
|
||||
</Card>
|
||||
|
||||
70
plugin_dev_en/0222-debugging-logs.en.mdx
Normal file
70
plugin_dev_en/0222-debugging-logs.en.mdx
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
dimensions:
|
||||
type:
|
||||
primary: implementation
|
||||
detail: standard
|
||||
level: intermediate
|
||||
standard_title: Debugging logs
|
||||
language: en
|
||||
description: Learn how to add logging to your Dify plugin tools for development and debugging purposes.
|
||||
title: Outputting Logs for Plugin Development and Debugging
|
||||
---
|
||||
|
||||
As a plugin developer, you may want to print arbitrary strings to logs during plugin processing for development or debugging purposes.
|
||||
|
||||
For this purpose, the plugin SDK implements a handler for Python's standard `logging` library. By using this, you can output any string to both the **standard output during remote debugging** and the **plugin daemon container logs** (community edition only).
|
||||
|
||||
## Sample
|
||||
|
||||
Import `plugin_logger_handler` and add it to your logger as a handler. Below is a sample code for a tool plugin.
|
||||
|
||||
```python
|
||||
from collections.abc import Generator
|
||||
from typing import Any
|
||||
from dify_plugin import Tool
|
||||
from dify_plugin.entities.tool import ToolInvokeMessage
|
||||
|
||||
|
||||
# Import logging and custom handler
|
||||
import logging
|
||||
from dify_plugin.config.logger_format import plugin_logger_handler
|
||||
|
||||
# Set up logging with the custom handler
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.setLevel(logging.INFO)
|
||||
logger.addHandler(plugin_logger_handler)
|
||||
|
||||
|
||||
class LoggerDemoTool(Tool):
|
||||
def _invoke(self, tool_parameters: dict[str, Any]) -> Generator[ToolInvokeMessage]:
|
||||
|
||||
# Log messages with different severity levels
|
||||
logger.info("This is a INFO log message.")
|
||||
logger.warning("This is a WARNING log message.")
|
||||
logger.error("This is a ERROR log message.")
|
||||
|
||||
yield self.create_text_message("Hello, Dify!")
|
||||
```
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/plugin_dev_en/0222-debugging-logs.en.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20debugging-logs&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fplugin_dev_en%2F0222-debugging-logs.en.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -7,7 +7,12 @@ dimensions:
|
||||
standard_title: Contributor Covenant Code of Conduct
|
||||
language: en
|
||||
title: Plugin Development Guidelines
|
||||
description: To ensure the quality of all plugins in the Dify Marketplace and provide a consistent, high-quality experience for Dify Marketplace users, you must adhere to all requirements outlined in these Plugin Development Guidelines when submitting a plugin for review. By submitting a plugin, **you acknowledge that you have read, understood, and agree to comply with all the following terms**. Following these guidelines will help your plugin get reviewed faster.
|
||||
description: To ensure the quality of all plugins in the Dify Marketplace and provide
|
||||
a consistent, high-quality experience for Dify Marketplace users, you must adhere
|
||||
to all requirements outlined in these Plugin Development Guidelines when submitting
|
||||
a plugin for review. By submitting a plugin, **you acknowledge that you have read,
|
||||
understood, and agree to comply with all the following terms**. Following these
|
||||
guidelines will help your plugin get reviewed faster.
|
||||
---
|
||||
|
||||
## 1. Plugin Value and Uniqueness
|
||||
|
||||
131
plugin_dev_en/0312-third-party-signature-verification.en.mdx
Normal file
131
plugin_dev_en/0312-third-party-signature-verification.en.mdx
Normal file
@@ -0,0 +1,131 @@
|
||||
---
|
||||
dimensions:
|
||||
type:
|
||||
primary: operational
|
||||
detail: setup
|
||||
level: intermediate
|
||||
standard_title: Third-Party Signature Verification
|
||||
language: en
|
||||
title: Signing Plugins for Third-Party Signature Verification
|
||||
description: This document describes how to enable and use the third-party signature verification feature in the Dify Community Edition, including key pair generation, plugin signing and verification, and environment configuration steps, enabling administrators to securely install plugins not available on the Dify Marketplace.
|
||||
---
|
||||
|
||||
---
|
||||
title:
|
||||
---
|
||||
|
||||
<Warning>This feature is available only in the Dify Community Edition. Third-party signature verification is not currently supported on Dify Cloud Edition.</Warning>
|
||||
|
||||
Third-party signature verification allows Dify administrators to safely approve the installation of plugins not listed on the Dify Marketplace without completely disabling signature verification. This supports the following scenarios for example:
|
||||
|
||||
* Dify administrators can add a signature to a plugin sent by the developer once it has been approved.
|
||||
* Plugin developers can add a signature to their plugin and publish it along with the public key for Dify administrators who cannot disable signature verification.
|
||||
|
||||
Both Dify administrators and plugin developers can add a signature to a plugin using a pre-generated key pair. Additionally, administrators can configure Dify to enforce signature verification using specific public keys during plugin installation.
|
||||
|
||||
## Generating a Key Pair for Signing and Verification
|
||||
|
||||
Generate a new key pair for adding and verifying the plugin's signature with the following command:
|
||||
|
||||
```bash
|
||||
dify signature generate -f your_key_pair
|
||||
```
|
||||
|
||||
After running this command, two files will be generated in the current directory:
|
||||
|
||||
* **Private Key**: `your_key_pair.private.pem`
|
||||
* **Public Key**: `your_key_pair.public.pem`
|
||||
|
||||
The private key is used to sign the plugin, and the public key is used to verify the plugin's signature.
|
||||
|
||||
<Warning>Keep the private key secure. If it is compromised, an attacker could add a valid signature to any plugin, which would compromise Dify's security.</Warning>
|
||||
|
||||
## Adding a Signature to the Plugin and Veriyfing It
|
||||
|
||||
Add a signature to your plugin by running the following command. Note that you must specify the **plugin file to sign** and the **private key**:
|
||||
|
||||
```bash
|
||||
dify signature sign your_plugin_project.difypkg -p your_key_pair.private.pem
|
||||
```
|
||||
|
||||
After executing the command, a new plugin file will be generated in the same directory with `signed` added to its original filename: `your_plugin_project.signed.difypkg`
|
||||
|
||||
You can verify that the plugin has been correctly signed using this command. Here, you need to specify the **signed plugin file** and the **public key**:
|
||||
|
||||
```bash
|
||||
dify signature verify your_plugin_project.signed.difypkg -p your_key_pair.public.pem
|
||||
```
|
||||
|
||||
<Info>If you omit the public key argument, verification will use the Dify Marketplace public key. In that case, signature verification will fail for any plugin file not downloaded from the Dify Marketplace.</Info>
|
||||
|
||||
## Enabling Third-Party Signature Verification
|
||||
|
||||
Dify administrators can enforce signature verification using pre-approved public keys before installing a plugin.
|
||||
|
||||
### Placing the Public Key
|
||||
|
||||
Place the **public key** corresponding to the private key used for signing in a location that the plugin daemon can access.
|
||||
|
||||
For example, create a `public_keys` directory under `docker/volumes/plugin_daemon` and copy the public key file there:
|
||||
|
||||
```bash
|
||||
mkdir docker/volumes/plugin_daemon/public_keys
|
||||
cp your_key_pair.public.pem docker/volumes/plugin_daemon/public_keys
|
||||
```
|
||||
|
||||
### Environment Variable Configuration
|
||||
|
||||
In the `plugin_daemon` container, configure the following environment variables:
|
||||
|
||||
* `THIRD_PARTY_SIGNATURE_VERIFICATION_ENABLED`
|
||||
* Enables third-party signature verification.
|
||||
* Set this to `true` to enable the feature.
|
||||
* `THIRD_PARTY_SIGNATURE_VERIFICATION_PUBLIC_KEYS`
|
||||
* Specifies the path(s) to the public key file(s) used for signature verification.
|
||||
* You can list multiple public key files separated by commas.
|
||||
|
||||
Below is an example of a Docker Compose override file (`docker-compose.override.yaml`) configuring these variables:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
plugin_daemon:
|
||||
environment:
|
||||
FORCE_VERIFYING_SIGNATURE: true
|
||||
THIRD_PARTY_SIGNATURE_VERIFICATION_ENABLED: true
|
||||
THIRD_PARTY_SIGNATURE_VERIFICATION_PUBLIC_KEYS: /app/storage/public_keys/your_key_pair.public.pem
|
||||
```
|
||||
|
||||
<Info>Note that `docker/volumes/plugin_daemon` is mounted to `/app/storage` in the `plugin_daemon` container. Ensure that the path specified in `THIRD_PARTY_SIGNATURE_VERIFICATION_PUBLIC_KEYS` corresponds to the path inside the container.</Info>
|
||||
|
||||
To apply these changes, restart the Dify service:
|
||||
|
||||
```bash
|
||||
cd docker
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
After restarting the service, the third-party signature verification feature will be enabled in the current Community Edition environment.
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/plugin_dev_en/0312-third-party-signature-verification.en.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20third-party-signature-verification&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fplugin_dev_en%2F0312-third-party-signature-verification.en.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
</CardGroup>
|
||||
328
plugin_dev_en/0321-plugin-auto-publish-pr.en.mdx
Normal file
328
plugin_dev_en/0321-plugin-auto-publish-pr.en.mdx
Normal file
@@ -0,0 +1,328 @@
|
||||
---
|
||||
dimensions:
|
||||
type:
|
||||
primary: operational
|
||||
detail: deployment
|
||||
level: beginner
|
||||
standard_title: Plugin Auto Publish PR
|
||||
language: en
|
||||
title: Automatically Publish Plugins via PR
|
||||
description: This document describes how to automate the release process of Dify plugins using GitHub Actions, including configuration steps, parameter descriptions, and usage methods, helping plugin developers streamline the release process without manual intervention.
|
||||
---
|
||||
|
||||
### Background
|
||||
|
||||
Updating plugins that others are actively using can be tedious. Traditionally, you would need to modify code, bump versions, push changes, create branches, package files, and submit PRs manually - a repetitive process that slows down development.
|
||||
|
||||
Thus, we have created **Plugin Auto-PR**, a GitHub Actions workflow that automates the entire process. Now you can package, push, and create PRs with a single action, focusing on building great plugins.
|
||||
|
||||
### Concepts
|
||||
|
||||
#### GitHub Actions
|
||||
|
||||
GitHub Actions automates your development tasks in GitHub.
|
||||
|
||||
**How it works**: When triggered (e.g., by a code push), it runs your workflow in a cloud-based virtual machine, handling everything from build to deployment automatically.
|
||||
|
||||

|
||||
|
||||
**Limits**:
|
||||
|
||||
* Public repositories: Unlimited
|
||||
* Private repositories: 2000 minutes per month
|
||||
|
||||
#### Plugin Auto-PR
|
||||
|
||||
**How it works**:
|
||||
|
||||
1. Workflow triggers when you push code to the main branch of your plugin source repository
|
||||
2. Workflow reads plugin information from the `manifest.yaml` file
|
||||
3. Automatically packages the plugin as a `.difypkg` file
|
||||
4. Pushes the packaged file to your forked `dify-plugins` repository
|
||||
5. Creates a new branch and commits changes
|
||||
6. Automatically creates a PR to merge into the upstream repository
|
||||
|
||||
### Prerequisites
|
||||
|
||||
#### Repository
|
||||
|
||||
* You already have your own plugin source code repository (e.g., `your-name/plugin-source`)
|
||||
* You already have your own forked plugin repository (e.g., `your-name/dify-plugins`)
|
||||
* Your forked repository already has the plugin directory structure:
|
||||
|
||||
```
|
||||
dify-plugins/
|
||||
└── your-author-name
|
||||
└── plugin-name
|
||||
```
|
||||
|
||||
#### Permission
|
||||
|
||||
This workflow requires appropriate permissions to function:
|
||||
|
||||
* You need to create a GitHub Personal Access Token (PAT) with sufficient permissions
|
||||
* The PAT must have permission to push code to your forked repository
|
||||
* The PAT must have permission to create PRs to the upstream repository
|
||||
|
||||
### Parameters and Configuration
|
||||
|
||||
#### Setup Requirements
|
||||
|
||||
To get started with auto-publishing, you will need two key components:
|
||||
|
||||
**manifest.yaml file**: This file drives the automation process:
|
||||
|
||||
* `name`: Your plugin’s name (affects package and branch names)
|
||||
* `version`: Semantic version number (increment with each release)
|
||||
* `author`: Your GitHub username (determines repository paths)
|
||||
|
||||
**PLUGIN\_ACTION Secret**: You need to add this secret to your plugin source repository:
|
||||
|
||||
* Value: Must be a Personal Access Token (PAT) with sufficient permissions
|
||||
* Permission: Ability to push branches to your forked repository and create PRs to the upstream repository
|
||||
|
||||
#### Automatically-Generated Parameters
|
||||
|
||||
Once set up, the workflow automatically handles these parameters:
|
||||
|
||||
* GitHub username: Read from the `author` field in `manifest.yaml`
|
||||
* Author folder name: Consistent with the `author` field
|
||||
* Plugin name: Read from the `name` field in `manifest.yaml`
|
||||
* Branch name: `bump-{plugin-name}-plugin-{version}`
|
||||
* Package filename: `{plugin-name}-{version}.difypkg`
|
||||
* PR title and content: Automatically generated based on plugin name and version
|
||||
|
||||
### Step-by-Step Guide
|
||||
|
||||
<Steps>
|
||||
<Step title="Prepare Repositories">
|
||||
Ensure you have forked the official `dify-plugins` repository and have your own plugin source repository.
|
||||
</Step>
|
||||
<Step title="Configure Secret">
|
||||
Navigate to your plugin source repository, click **Settings > Secrets and variables > Actions > New repository secret**, and create a GitHub Secret:
|
||||
|
||||
* Name: `PLUGIN_ACTION`
|
||||
* Value: GitHub Personal Access Token (PAT) with write permissions to the target repository (`your-name/dify-plugins`)
|
||||
|
||||
<img src="https://assets-docs.dify.ai/2025/04/8abd72b677dd24752910c304c76f1c26.png" alt="Create Secrets" />
|
||||
</Step>
|
||||
<Step title="Create Workflow File">
|
||||
Create a `.github/workflows/` directory in your repository, create a file named `plugin-publish.yml` in this directory, and copy the following content into the file:
|
||||
|
||||
```yaml
|
||||
# .github/workflows/auto-pr.yml
|
||||
name: Auto Create PR on Main Push
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ] # Trigger on push to main
|
||||
|
||||
jobs:
|
||||
create_pr: # Renamed job for clarity
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Print working directory # Kept for debugging
|
||||
run: |
|
||||
pwd
|
||||
ls -la
|
||||
|
||||
- name: Download CLI tool
|
||||
run: |
|
||||
# Create bin directory in runner temp
|
||||
mkdir -p $RUNNER_TEMP/bin
|
||||
cd $RUNNER_TEMP/bin
|
||||
|
||||
# Download CLI tool
|
||||
wget https://github.com/langgenius/dify-plugin-daemon/releases/download/0.0.6/dify-plugin-linux-amd64
|
||||
chmod +x dify-plugin-linux-amd64
|
||||
|
||||
# Show download location and file
|
||||
echo "CLI tool location:"
|
||||
pwd
|
||||
ls -la dify-plugin-linux-amd64
|
||||
|
||||
- name: Get basic info from manifest # Changed step name and content
|
||||
id: get_basic_info
|
||||
run: |
|
||||
PLUGIN_NAME=$(grep "^name:" manifest.yaml | cut -d' ' -f2)
|
||||
echo "Plugin name: $PLUGIN_NAME"
|
||||
echo "plugin_name=$PLUGIN_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
VERSION=$(grep "^version:" manifest.yaml | cut -d' ' -f2)
|
||||
echo "Plugin version: $VERSION"
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
# If the author's name is not your github username, you can change the author here
|
||||
AUTHOR=$(grep "^author:" manifest.yaml | cut -d' ' -f2)
|
||||
echo "Plugin author: $AUTHOR"
|
||||
echo "author=$AUTHOR" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Package Plugin
|
||||
id: package
|
||||
run: |
|
||||
# Use the downloaded CLI tool to package
|
||||
cd $GITHUB_WORKSPACE
|
||||
# Use variables for package name
|
||||
PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
|
||||
# Use CLI from runner temp
|
||||
$RUNNER_TEMP/bin/dify-plugin-linux-amd64 plugin package . -o "$PACKAGE_NAME"
|
||||
|
||||
# Show packaging result
|
||||
echo "Package result:"
|
||||
ls -la "$PACKAGE_NAME"
|
||||
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
|
||||
|
||||
# Show full file path and directory structure (kept for debugging)
|
||||
echo "\\nFull file path:"
|
||||
pwd
|
||||
echo "\\nDirectory structure:"
|
||||
tree || ls -R
|
||||
|
||||
- name: Checkout target repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
# Use author variable for repository
|
||||
repository: ${{steps.get_basic_info.outputs.author}}/dify-plugins
|
||||
path: dify-plugins
|
||||
token: ${{ secrets.PLUGIN_ACTION }}
|
||||
fetch-depth: 1 # Fetch only the last commit to speed up checkout
|
||||
persist-credentials: true # Persist credentials for subsequent git operations
|
||||
|
||||
- name: Prepare and create PR
|
||||
run: |
|
||||
# Debug info (kept)
|
||||
echo "Debug: Current directory $(pwd)"
|
||||
# Use variable for package name
|
||||
PACKAGE_NAME="${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}.difypkg"
|
||||
echo "Debug: Package name: $PACKAGE_NAME"
|
||||
ls -la
|
||||
|
||||
# Move the packaged file to the target directory using variables
|
||||
mkdir -p dify-plugins/${{ steps.get_basic_info.outputs.author }}/${{ steps.get_basic_info.outputs.plugin_name }}
|
||||
mv "$PACKAGE_NAME" dify-plugins/${{ steps.get_basic_info.outputs.author }}/${{ steps.get_basic_info.outputs.plugin_name }}/
|
||||
|
||||
# Enter the target repository directory
|
||||
cd dify-plugins
|
||||
|
||||
# Configure git
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
|
||||
# Ensure we are on the latest main branch
|
||||
git fetch origin main
|
||||
git checkout main
|
||||
git pull origin main
|
||||
|
||||
# Create and switch to a new branch using variables and new naming convention
|
||||
BRANCH_NAME="bump-${{ steps.get_basic_info.outputs.plugin_name }}-plugin-${{ steps.get_basic_info.outputs.version }}"
|
||||
git checkout -b "$BRANCH_NAME"
|
||||
|
||||
# Add and commit changes (using git add .)
|
||||
git add .
|
||||
git status # for debugging
|
||||
# Use variables in commit message
|
||||
git commit -m "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin to version ${{ steps.get_basic_info.outputs.version }}"
|
||||
|
||||
# Push to remote (use force just in case the branch existed before from a failed run)
|
||||
git push -u origin "$BRANCH_NAME" --force
|
||||
|
||||
# Confirm branch has been pushed and wait for sync (GitHub API might need a moment)
|
||||
git branch -a
|
||||
echo "Waiting for branch to sync..."
|
||||
sleep 10 # Wait 10 seconds for branch sync
|
||||
|
||||
- name: Create PR via GitHub API
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.PLUGIN_ACTION }} # Use the provided token for authentication
|
||||
run: |
|
||||
gh pr create \
|
||||
--repo langgenius/dify-plugins \
|
||||
--head "${{ steps.get_basic_info.outputs.author }}:${{ steps.get_basic_info.outputs.plugin_name }}-${{ steps.get_basic_info.outputs.version }}" \
|
||||
--base main \
|
||||
--title "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin to version ${{ steps.get_basic_info.outputs.version }}" \
|
||||
--body "bump ${{ steps.get_basic_info.outputs.plugin_name }} plugin package to version ${{ steps.get_basic_info.outputs.version }}
|
||||
|
||||
Changes:
|
||||
- Updated plugin package file" || echo "PR already exists or creation skipped." # Handle cases where PR already exists
|
||||
|
||||
- name: Print environment info # Kept for debugging
|
||||
run: |
|
||||
echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE"
|
||||
echo "Current directory contents:"
|
||||
ls -R
|
||||
```
|
||||
</Step>
|
||||
<Step title="Update manifest.yaml">
|
||||
Ensure those following fields are correctly set:
|
||||
|
||||
```yaml
|
||||
version: 0.0.x # Version number
|
||||
author: your-github-username # GitHub username/Author name
|
||||
name: your-plugin-name # Plugin name
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Usage Guide
|
||||
|
||||
#### First-time Setup
|
||||
|
||||
When setting up the auto-publish workflow for the first time, complete these steps:
|
||||
|
||||
1. Ensure you have forked the official `dify-plugins` repository
|
||||
2. Ensure your plugin source repository structure is correct
|
||||
3. Set up the `PLUGIN_ACTION Secret` in your plugin source repository
|
||||
4. Create the workflow file `.github/workflows/plugin-publish.yml`
|
||||
5. Ensure the `name` and `author` fields in the `manifest.yaml` file are correctly configured
|
||||
|
||||
#### Subsequent Update
|
||||
|
||||
To publish new versions after setup:
|
||||
|
||||
1. Modify the code
|
||||
2. Update the `version` field in `manifest.yaml`
|
||||
|
||||

|
||||
|
||||
3. Push all changes to the main branch
|
||||
4. Wait for GitHub Actions to complete packaging, branch creation, and PR submission
|
||||
|
||||
### Outcome
|
||||
|
||||
When you push code to the main branch of your plugin source repository, GitHub Actions will automatically execute the publishing process:
|
||||
|
||||
* Package the plugin in `{plugin-name}-{version}.difypkg` format
|
||||
* Push the packaged file to the target repository
|
||||
* Create a PR to merge into the fork repository
|
||||
|
||||

|
||||
|
||||
### Example Repository
|
||||
|
||||
See [example repository](https://github.com/Yevanchen/exa-in-dify) to understand configuration and best practices.
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/plugin_dev_en/0321-plugin-auto-publish-pr.en.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20plugin-auto-publish-pr&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fplugin_dev_en%2F0321-plugin-auto-publish-pr.en.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
</CardGroup>
|
||||
51
plugin_dev_en/0431-example-overview-and-index.en.mdx
Normal file
51
plugin_dev_en/0431-example-overview-and-index.en.mdx
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
dimensions:
|
||||
type:
|
||||
primary: reference
|
||||
detail: examples
|
||||
level: beginner
|
||||
standard_title: Example Overview and Index
|
||||
language: en
|
||||
title: Examples
|
||||
---
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Develop A Slack Bot Plugin"
|
||||
icon="link"
|
||||
href="plugin_dev_en/0432-develop-a-slack-bot-plugin.en"
|
||||
horizontal
|
||||
>
|
||||
tool-plugin
|
||||
</Card>
|
||||
<Card
|
||||
title="Neko Cat Endpoint"
|
||||
icon="link"
|
||||
href="plugin_dev_en/0432-endpoint.en"
|
||||
>
|
||||
extension-plugin
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="Edit this page"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/plugin_dev_en/0431-example-overview-and-index.en.mdx"
|
||||
>
|
||||
Help improve our documentation by contributing directly
|
||||
</Card>
|
||||
<Card
|
||||
title="Report an issue"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=Documentation%20Issue%3A%20example-overview-and-index&body=%23%23%20Issue%20Description%0A%3C%21--%20Please%20briefly%20describe%20the%20issue%20you%20found%20--%3E%0A%0A%23%23%20Page%20Link%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fplugin_dev_en%2F0431-example-overview-and-index.en.mdx%0A%0A%23%23%20Suggested%20Changes%0A%3C%21--%20If%20you%20have%20specific%20suggestions%20for%20changes%2C%20please%20describe%20them%20here%20--%3E%0A%0A%3C%21--%20Thank%20you%20for%20helping%20improve%20our%20documentation%21%20--%3E"
|
||||
>
|
||||
Found an error or have suggestions? Let us know
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -6,7 +6,7 @@ dimensions:
|
||||
level: intermediate
|
||||
standard_title: Endpoint
|
||||
language: en
|
||||
title: Endpoint
|
||||
title: Neko Cat Endpoint
|
||||
description: Authors Yeuoly, Allen. This document details the structure and implementation
|
||||
of Endpoints in Dify plugins, using the Neko Cat project as an example. It covers
|
||||
defining Endpoint groups, configuring interfaces, implementing the _invoke method,
|
||||
|
||||
193
plugin_dev_en/sync/check_mapping_consistency.py
Normal file
193
plugin_dev_en/sync/check_mapping_consistency.py
Normal file
@@ -0,0 +1,193 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
文件映射一致性检查工具
|
||||
对比 JSON 映射记录与实际文件情况,确保映射准确无误
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Set, Dict
|
||||
|
||||
# ANSI 颜色代码
|
||||
GREEN = '\033[92m'
|
||||
YELLOW = '\033[93m'
|
||||
RED = '\033[91m'
|
||||
BLUE = '\033[94m'
|
||||
CYAN = '\033[96m'
|
||||
RESET = '\033[0m'
|
||||
|
||||
class MappingValidator:
|
||||
def __init__(self, json_file: str = "plugin_mappings.json"):
|
||||
script_file_path = Path(os.path.abspath(__file__)).resolve()
|
||||
|
||||
|
||||
self.base_dir = script_file_path.parent.parent.parent
|
||||
|
||||
self.json_file = script_file_path.parent / json_file
|
||||
|
||||
# plugin_dir 是 <workspace_root>/en/plugins
|
||||
self.plugin_dir = self.base_dir / "en" / "plugins"
|
||||
|
||||
# dev_dir 是 <workspace_root>/plugin_dev_en
|
||||
self.dev_dir = self.base_dir / "plugin_dev_en"
|
||||
|
||||
self.mappings = []
|
||||
self.load_mappings()
|
||||
|
||||
def load_mappings(self):
|
||||
"""加载映射文件"""
|
||||
try:
|
||||
with open(self.json_file, 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
self.mappings = data.get('mappings', [])
|
||||
except FileNotFoundError:
|
||||
print(f"{RED}错误: 找不到文件 {self.json_file}{RESET}")
|
||||
self.mappings = []
|
||||
except json.JSONDecodeError:
|
||||
print(f"{RED}错误: JSON 文件格式错误{RESET}")
|
||||
self.mappings = []
|
||||
|
||||
def count_mdx_files(self, directory: Path) -> int:
|
||||
"""递归统计目录中的 .mdx 文件数量"""
|
||||
count = 0
|
||||
for file in directory.rglob('*.mdx'):
|
||||
count += 1
|
||||
return count
|
||||
|
||||
def get_actual_file_paths(self, directory: Path) -> Set[str]:
|
||||
"""获取目录中所有 .mdx 文件的相对路径"""
|
||||
files = set()
|
||||
for file in directory.rglob('*.mdx'):
|
||||
relative_path = str(file.relative_to(self.base_dir))
|
||||
files.add(relative_path)
|
||||
return files
|
||||
|
||||
def calculate_mapping_stats(self) -> Dict:
|
||||
"""计算映射统计"""
|
||||
total = len(self.mappings)
|
||||
plugin_only = sum(1 for m in self.mappings if m.get('plugin_path') and not m.get('dev_path'))
|
||||
dev_only = sum(1 for m in self.mappings if m.get('dev_path') and not m.get('plugin_path'))
|
||||
complete = sum(1 for m in self.mappings if m.get('plugin_path') and m.get('dev_path'))
|
||||
|
||||
# 计算预期的文件数
|
||||
expected_plugin_files = total - dev_only # 总数 - 仅开发 = 插件文件数
|
||||
expected_dev_files = total - plugin_only # 总数 - 仅插件 = 开发文件数
|
||||
|
||||
return {
|
||||
'total_mappings': total,
|
||||
'plugin_only': plugin_only,
|
||||
'dev_only': dev_only,
|
||||
'complete_mappings': complete,
|
||||
'expected_plugin_files': expected_plugin_files,
|
||||
'expected_dev_files': expected_dev_files
|
||||
}
|
||||
|
||||
def validate(self):
|
||||
"""执行验证"""
|
||||
print(f"\n{CYAN}=== 插件文档映射一致性检查工具 ==={RESET}")
|
||||
print(f"{CYAN}功能:对比 JSON 映射记录与实际文件,确保映射准确无遗漏{RESET}\n")
|
||||
|
||||
# 统计实际文件数
|
||||
actual_plugin_count = self.count_mdx_files(self.plugin_dir)
|
||||
actual_dev_count = self.count_mdx_files(self.dev_dir)
|
||||
|
||||
# 获取映射统计
|
||||
stats = self.calculate_mapping_stats()
|
||||
|
||||
# 显示映射统计
|
||||
print(f"{BLUE}【JSON 映射统计情况】{RESET}")
|
||||
print(f" 总映射记录数: {stats['total_mappings']} 条")
|
||||
print(f" 完整映射(两边都有): {stats['complete_mappings']} 条")
|
||||
print(f" 仅插件文档: {stats['plugin_only']} 条")
|
||||
print(f" 仅开发文档: {stats['dev_only']} 条\n")
|
||||
|
||||
# 显示预期vs实际
|
||||
print(f"{BLUE}【运行时文件计数情况】{RESET}")
|
||||
print(" 📁 插件文件夹 (en/plugins):")
|
||||
print(f" JSON 映射预期: {stats['expected_plugin_files']} 个文件")
|
||||
print(f" 实际扫描结果: {actual_plugin_count} 个 .mdx 文件")
|
||||
if actual_plugin_count == stats['expected_plugin_files']:
|
||||
print(f" 状态: {GREEN}✓ 完全一致{RESET}")
|
||||
else:
|
||||
diff = actual_plugin_count - stats['expected_plugin_files']
|
||||
print(f" 状态: {RED}✗ 存在差异 (实际比预期{diff:+d}){RESET}")
|
||||
|
||||
print("\n 📁 开发文件夹 (plugin_dev_en):")
|
||||
print(f" JSON 映射预期: {stats['expected_dev_files']} 个文件")
|
||||
print(f" 实际扫描结果: {actual_dev_count} 个 .mdx 文件")
|
||||
if actual_dev_count == stats['expected_dev_files']:
|
||||
print(f" 状态: {GREEN}✓ 完全一致{RESET}")
|
||||
else:
|
||||
diff = actual_dev_count - stats['expected_dev_files']
|
||||
print(f" 状态: {RED}✗ 存在差异 (实际比预期{diff:+d}){RESET}")
|
||||
|
||||
# 显示计算公式说明
|
||||
print(f"\n{BLUE}【预期文件数计算说明】{RESET}")
|
||||
print(f" 插件预期数 = 总映射数({stats['total_mappings']}) - 仅开发数({stats['dev_only']}) = {stats['expected_plugin_files']}")
|
||||
print(f" 开发预期数 = 总映射数({stats['total_mappings']}) - 仅插件数({stats['plugin_only']}) = {stats['expected_dev_files']}")
|
||||
|
||||
# 如果有差异,找出具体文件
|
||||
if actual_plugin_count != stats['expected_plugin_files'] or actual_dev_count != stats['expected_dev_files']:
|
||||
self.find_discrepancies()
|
||||
else:
|
||||
print(f"\n{GREEN}✅ 检查完成:所有文件映射完全一致!{RESET}")
|
||||
|
||||
def find_discrepancies(self):
|
||||
"""找出映射和实际文件的差异"""
|
||||
print(f"\n{YELLOW}【差异详细分析】{RESET}\n")
|
||||
|
||||
# 获取实际文件路径
|
||||
actual_plugin_files = self.get_actual_file_paths(self.plugin_dir)
|
||||
actual_dev_files = self.get_actual_file_paths(self.dev_dir)
|
||||
|
||||
# 获取映射中的文件路径
|
||||
mapped_plugin_files = set(m['plugin_path'] for m in self.mappings if m.get('plugin_path'))
|
||||
mapped_dev_files = set(m['dev_path'] for m in self.mappings if m.get('dev_path'))
|
||||
|
||||
# 找出未映射的文件
|
||||
unmapped_plugin_files = actual_plugin_files - mapped_plugin_files
|
||||
unmapped_dev_files = actual_dev_files - mapped_dev_files
|
||||
|
||||
# 找出映射中但不存在的文件
|
||||
nonexistent_plugin_files = mapped_plugin_files - actual_plugin_files
|
||||
nonexistent_dev_files = mapped_dev_files - actual_dev_files
|
||||
|
||||
has_issues = False
|
||||
|
||||
if unmapped_plugin_files:
|
||||
has_issues = True
|
||||
print(f"{RED}❗ 实际存在但 JSON 中未记录的插件文件:{RESET}")
|
||||
for file in sorted(unmapped_plugin_files):
|
||||
print(f" - {file}")
|
||||
|
||||
if unmapped_dev_files:
|
||||
has_issues = True
|
||||
print(f"\n{RED}❗ 实际存在但 JSON 中未记录的开发文件:{RESET}")
|
||||
for file in sorted(unmapped_dev_files):
|
||||
print(f" - {file}")
|
||||
|
||||
if nonexistent_plugin_files:
|
||||
has_issues = True
|
||||
print(f"\n{RED}❗ JSON 中记录但实际不存在的插件文件:{RESET}")
|
||||
for file in sorted(nonexistent_plugin_files):
|
||||
print(f" - {file}")
|
||||
|
||||
if nonexistent_dev_files:
|
||||
has_issues = True
|
||||
print(f"\n{RED}❗ JSON 中记录但实际不存在的开发文件:{RESET}")
|
||||
for file in sorted(nonexistent_dev_files):
|
||||
print(f" - {file}")
|
||||
|
||||
if has_issues:
|
||||
print(f"\n{YELLOW}💡 建议:运行 sync_mdx_to_json.py 同步文件到映射{RESET}")
|
||||
else:
|
||||
print(f"{GREEN}未发现具体文件差异,检查完成{RESET}")
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
validator = MappingValidator()
|
||||
validator.validate()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
243
plugin_dev_en/sync/plugin_mappings.json
Normal file
243
plugin_dev_en/sync/plugin_mappings.json
Normal file
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"mappings": [
|
||||
{
|
||||
"plugin_path": "en/plugins/introduction.mdx",
|
||||
"dev_path": null,
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/manage-plugins.mdx",
|
||||
"dev_path": null,
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/README.mdx",
|
||||
"dev_path": "plugin_dev_en/0111-getting-started-dify-plugin.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": null,
|
||||
"dev_path": "plugin_dev_en/0211-getting-started-new-model.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/faq.mdx",
|
||||
"dev_path": "plugin_dev_en/0331-faq.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/tool-plugin.mdx",
|
||||
"dev_path": "plugin_dev_en/0222-tool-plugin.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/model-plugin/README.mdx",
|
||||
"dev_path": "plugin_dev_en/0411-model-plugin-introduction.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/initialize-development-tools.mdx",
|
||||
"dev_path": "plugin_dev_en/0221-initialize-development-tools.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/model-plugin/create-model-providers.mdx",
|
||||
"dev_path": "plugin_dev_en/0222-creating-new-model-provider.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/publish-plugins/README.mdx",
|
||||
"dev_path": "plugin_dev_en/0321-release-overview.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/publish-plugins/package-plugin-file-and-publish.mdx",
|
||||
"dev_path": "plugin_dev_en/0322-release-by-file.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/publish-plugins/publish-to-dify-marketplace/README.mdx",
|
||||
"dev_path": "plugin_dev_en/0322-release-to-dify-marketplace.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/publish-plugins/publish-plugin-on-personal-github-repo.mdx",
|
||||
"dev_path": "plugin_dev_en/0322-release-to-individual-github-repo.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/publish-plugins/publish-to-dify-marketplace/plugin-developer-guidelines.mdx",
|
||||
"dev_path": "plugin_dev_en/0312-contributor-covenant-code-of-conduct.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/publish-plugins/publish-to-dify-marketplace/plugin-privacy-protection-guidelines.mdx",
|
||||
"dev_path": "plugin_dev_en/0312-privacy-protection-guidelines.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/general-specifications.mdx",
|
||||
"dev_path": "plugin_dev_en/0411-general-specifications.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/model/model-designing-rules.mdx",
|
||||
"dev_path": "plugin_dev_en/0411-model-designing-rules.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/persistent-storage.mdx",
|
||||
"dev_path": "plugin_dev_en/0411-persistent-storage-kv.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/manifest.mdx",
|
||||
"dev_path": "plugin_dev_en/0411-plugin-info-by-manifest.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/debug-plugin.mdx",
|
||||
"dev_path": "plugin_dev_en/0411-remote-debug-a-plugin.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/tool.mdx",
|
||||
"dev_path": "plugin_dev_en/0411-tool.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/model/model-schema.mdx",
|
||||
"dev_path": "plugin_dev_en/0412-model-schema.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/best-practice/develop-a-slack-bot-plugin.mdx",
|
||||
"dev_path": "plugin_dev_en/0432-develop-a-slack-bot-plugin.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/endpoint.mdx",
|
||||
"dev_path": "plugin_dev_en/0432-endpoint.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/extension-plugin.mdx",
|
||||
"dev_path": "plugin_dev_en/9231-extension-plugin.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/agent.mdx",
|
||||
"dev_path": "plugin_dev_en/9232-agent.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/bundle.mdx",
|
||||
"dev_path": "plugin_dev_en/9241-bundle.en.mdx",
|
||||
"verified": true,
|
||||
"sync": "内容高度相同,已确认同步。"
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/reverse-invocation-of-the-dify-service/README.mdx",
|
||||
"dev_path": "plugin_dev_en/9241-reverse-invocation.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/reverse-invocation-of-the-dify-service/app.mdx",
|
||||
"dev_path": "plugin_dev_en/9242-reverse-invocation-app.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/reverse-invocation-of-the-dify-service/model.mdx",
|
||||
"dev_path": "plugin_dev_en/9242-reverse-invocation-model.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/reverse-invocation-of-the-dify-service/tool.mdx",
|
||||
"dev_path": "plugin_dev_en/9242-reverse-invocation-tool.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/model-plugin/customizable-model.mdx",
|
||||
"dev_path": "plugin_dev_en/9243-customizable-model.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/reverse-invocation-of-the-dify-service/node.mdx",
|
||||
"dev_path": "plugin_dev_en/9243-reverse-invocation-node.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/agent-strategy-plugin.mdx",
|
||||
"dev_path": "plugin_dev_en/9433-agent-strategy-plugin.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/install-plugins.mdx",
|
||||
"dev_path": null,
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/best-practice/how-to-print-strings-to-logs-for-debugging.mdx",
|
||||
"dev_path": "plugin_dev_en/0222-debugging-logs.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/best-practice/how-to-use-mcp-zapier.mdx",
|
||||
"dev_path": null,
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/develop-plugins/model-plugin/predefined-model.mdx",
|
||||
"dev_path": "plugin_dev_en/0222-creating-new-model-provider-extra.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/publish-plugins/plugin-auto-publish-pr.mdx",
|
||||
"dev_path": "plugin_dev_en/0321-plugin-auto-publish-pr.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/publish-plugins/signing-plugins-for-third-party-signature-verification.mdx",
|
||||
"dev_path": "plugin_dev_en/0312-third-party-signature-verification.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/quick-start/README.mdx",
|
||||
"dev_path": null,
|
||||
"verified": true,
|
||||
"sync": "TODO: 需要进行适配"
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/best-practice/README.mdx",
|
||||
"dev_path": "plugin_dev_en/0431-example-overview-and-index.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/model/README.mdx",
|
||||
"dev_path": null,
|
||||
"verified": true,
|
||||
"sync": "TODO: 移除即可"
|
||||
},
|
||||
{
|
||||
"plugin_path": "en/plugins/schema-definition/README.mdx",
|
||||
"dev_path": null,
|
||||
"verified": true,
|
||||
"sync": "TODO: 移除即可"
|
||||
},
|
||||
{
|
||||
"plugin_path": null,
|
||||
"dev_path": "plugin_dev_en/0131-cheatsheet.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": null,
|
||||
"dev_path": "plugin_dev_en/0211-getting-started-dify-tool.en.mdx",
|
||||
"verified": true
|
||||
},
|
||||
{
|
||||
"plugin_path": null,
|
||||
"dev_path": "plugin_dev_en/0211-getting-started-by-prompt.en.mdx",
|
||||
"verified": true
|
||||
}
|
||||
]
|
||||
}
|
||||
251
plugin_dev_en/sync/sync_all_mdx_files_to_json.py
Normal file
251
plugin_dev_en/sync/sync_all_mdx_files_to_json.py
Normal file
@@ -0,0 +1,251 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
同步 MDX 文件到映射
|
||||
确保所有 mdx 文件都在 JSON 映射中,并去除 metadata
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Set, Dict
|
||||
|
||||
|
||||
class MdxSyncManager:
|
||||
def __init__(self, json_file: str = "plugin_mappings.json"):
|
||||
self.base_dir = Path(os.path.dirname(
|
||||
# 指向项目根目录
|
||||
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
self.json_file = self.base_dir / "plugin_dev_en" / \
|
||||
"sync" / json_file # 修正 JSON 文件路径
|
||||
self.plugin_dir = self.base_dir / "en" / "plugins" # 指向英文插件目录
|
||||
self.dev_dir = self.base_dir / "plugin_dev_en" # 指向英文开发目录
|
||||
self.mappings = []
|
||||
self.load_mappings()
|
||||
|
||||
def load_mappings(self):
|
||||
"""加载现有映射"""
|
||||
try:
|
||||
with open(self.json_file, 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
# 只加载 mappings,忽略 metadata
|
||||
self.mappings = data.get('mappings', [])
|
||||
except FileNotFoundError:
|
||||
print(f"创建新的映射文件: {self.json_file}")
|
||||
self.mappings = []
|
||||
except json.JSONDecodeError:
|
||||
print("JSON 文件格式错误,创建新文件")
|
||||
self.mappings = []
|
||||
|
||||
def save_mappings(self):
|
||||
"""保存映射(不包含 metadata)"""
|
||||
# 只保存 mappings,不保存 metadata
|
||||
data = {
|
||||
'mappings': self.mappings
|
||||
}
|
||||
with open(self.json_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=2)
|
||||
|
||||
def get_mdx_files(self, directory: Path) -> Set[str]:
|
||||
"""获取目录中所有 mdx 文件的相对路径"""
|
||||
mdx_files = set()
|
||||
for file in directory.rglob('*.mdx'):
|
||||
relative_path = str(file.relative_to(self.base_dir))
|
||||
mdx_files.add(relative_path)
|
||||
return mdx_files
|
||||
|
||||
def get_existing_paths(self) -> Dict[str, Dict]:
|
||||
"""获取现有映射中的所有路径"""
|
||||
existing = {}
|
||||
for mapping in self.mappings:
|
||||
if mapping['plugin_path']:
|
||||
existing[mapping['plugin_path']] = mapping
|
||||
if mapping['dev_path']:
|
||||
existing[mapping['dev_path']] = mapping
|
||||
return existing
|
||||
|
||||
def get_base_filename(self, filepath: str) -> str:
|
||||
"""从文件路径中提取基本名称,移除扩展名和常见的语言代码。"""
|
||||
name = os.path.basename(filepath)
|
||||
# 顺序很重要:先匹配更具体的(如 .en.mdx),再匹配通用的(如 .mdx)
|
||||
if name.endswith('.en.mdx'):
|
||||
return name[:-7]
|
||||
elif name.endswith('.zh.mdx'): # 保留以处理多语言情况
|
||||
return name[:-7]
|
||||
elif name.endswith('.ja.mdx'): # 保留以处理多语言情况
|
||||
return name[:-7]
|
||||
elif name.endswith('.mdx'): # 通用 .mdx
|
||||
return name[:-4]
|
||||
return os.path.splitext(name)[0] # 备选方案:返回不含最后一个扩展名的名称
|
||||
|
||||
def _find_match_in_set(self, source_file_path: str, target_file_set: Set[str]) -> str | None:
|
||||
"""通过比较基本名称,在目标集合中查找源文件的匹配项。"""
|
||||
source_base = self.get_base_filename(source_file_path)
|
||||
for target_file in target_file_set:
|
||||
if self.get_base_filename(target_file) == source_base:
|
||||
return target_file
|
||||
return None
|
||||
|
||||
def find_matching_mapping(self, path: str) -> Dict | None:
|
||||
"""查找与给定路径匹配的映射"""
|
||||
for mapping in self.mappings:
|
||||
if mapping['plugin_path'] == path or mapping['dev_path'] == path:
|
||||
return mapping
|
||||
return None
|
||||
|
||||
def sync_files(self):
|
||||
"""同步文件到映射, 包括添加新文件、移除不存在的文件关联、并尝试链接对应文件。"""
|
||||
actual_plugin_files = self.get_mdx_files(self.plugin_dir)
|
||||
actual_dev_files = self.get_mdx_files(self.dev_dir)
|
||||
|
||||
made_changes = False
|
||||
|
||||
# 步骤 1: 从现有映射中修剪不存在的文件路径
|
||||
valid_mappings = []
|
||||
for mapping in self.mappings:
|
||||
plugin_path = mapping.get('plugin_path')
|
||||
dev_path = mapping.get('dev_path')
|
||||
|
||||
original_plugin_path_for_log = plugin_path
|
||||
original_dev_path_for_log = dev_path
|
||||
|
||||
path_changed_in_mapping = False
|
||||
if plugin_path and plugin_path not in actual_plugin_files:
|
||||
print(f"信息:插件文件 '{plugin_path}' 在映射中但实际不存在,将从该映射中移除。")
|
||||
mapping['plugin_path'] = None
|
||||
made_changes = True
|
||||
path_changed_in_mapping = True
|
||||
|
||||
if dev_path and dev_path not in actual_dev_files:
|
||||
print(f"信息:开发文件 '{dev_path}' 在映射中但实际不存在,将从该映射中移除。")
|
||||
mapping['dev_path'] = None
|
||||
made_changes = True
|
||||
path_changed_in_mapping = True
|
||||
|
||||
# 如果映射仍然至少有一个有效路径,则保留它
|
||||
if mapping.get('plugin_path') or mapping.get('dev_path'):
|
||||
valid_mappings.append(mapping)
|
||||
elif path_changed_in_mapping: # 因修剪而变为空
|
||||
print(
|
||||
f"信息:移除了一个空的映射条目 (原插件: {original_plugin_path_for_log}, 原开发: {original_dev_path_for_log})。")
|
||||
# made_changes 已在路径被设为 None 时置为 true
|
||||
|
||||
self.mappings = valid_mappings
|
||||
|
||||
# 步骤 2: 识别修剪后映射中当前代表的所有文件
|
||||
mapped_plugin_paths = {m['plugin_path']
|
||||
for m in self.mappings if m.get('plugin_path')}
|
||||
mapped_dev_paths = {m['dev_path']
|
||||
for m in self.mappings if m.get('dev_path')}
|
||||
|
||||
# 步骤 3: 添加/链接新的插件文件
|
||||
for p_file in actual_plugin_files:
|
||||
if p_file not in mapped_plugin_paths: # 这个插件文件不在任何映射的 plugin_path 中
|
||||
made_changes = True
|
||||
corresponding_dev_file = self._find_match_in_set(
|
||||
p_file, actual_dev_files)
|
||||
linked_to_existing_dev_mapping = False
|
||||
|
||||
if corresponding_dev_file:
|
||||
for m in self.mappings: # 寻找一个只有dev路径且匹配的现有映射
|
||||
if m.get('dev_path') == corresponding_dev_file and not m.get('plugin_path'):
|
||||
m['plugin_path'] = p_file
|
||||
print(
|
||||
f"链接新插件文件到现有开发映射: {p_file} -> {corresponding_dev_file}")
|
||||
mapped_plugin_paths.add(p_file)
|
||||
linked_to_existing_dev_mapping = True
|
||||
break
|
||||
|
||||
if not linked_to_existing_dev_mapping:
|
||||
new_mapping_entry = {
|
||||
'plugin_path': p_file, 'dev_path': None, 'verified': False}
|
||||
if corresponding_dev_file and corresponding_dev_file not in mapped_dev_paths:
|
||||
# 如果对应的dev文件也存在且尚未被映射,则一起加入新条目
|
||||
new_mapping_entry['dev_path'] = corresponding_dev_file
|
||||
mapped_dev_paths.add(corresponding_dev_file)
|
||||
print(
|
||||
f"添加新映射 (插件与新开发链接): {p_file} <-> {corresponding_dev_file}")
|
||||
else:
|
||||
print(f"添加新映射 (仅插件): {p_file}")
|
||||
self.mappings.append(new_mapping_entry)
|
||||
mapped_plugin_paths.add(p_file)
|
||||
|
||||
# 步骤 4: 添加/链接新的开发文件 (那些在步骤3中未被链接的)
|
||||
for d_file in actual_dev_files:
|
||||
if d_file not in mapped_dev_paths: # 这个开发文件不在任何映射的 dev_path 中
|
||||
made_changes = True
|
||||
corresponding_plugin_file = self._find_match_in_set(
|
||||
d_file, actual_plugin_files)
|
||||
linked_to_existing_plugin_mapping = False
|
||||
|
||||
if corresponding_plugin_file: # 对应的插件文件存在
|
||||
for m in self.mappings: # 寻找一个只有plugin路径且匹配的现有映射
|
||||
if m.get('plugin_path') == corresponding_plugin_file and not m.get('dev_path'):
|
||||
m['dev_path'] = d_file
|
||||
print(
|
||||
f"链接新开发文件到现有插件映射: {corresponding_plugin_file} <- {d_file}")
|
||||
mapped_dev_paths.add(d_file)
|
||||
linked_to_existing_plugin_mapping = True
|
||||
break
|
||||
|
||||
if not linked_to_existing_plugin_mapping:
|
||||
# 如果没有找到可链接的仅插件映射,则添加为新的仅开发映射
|
||||
print(f"添加新映射 (仅开发): {d_file}")
|
||||
self.mappings.append(
|
||||
{'plugin_path': None, 'dev_path': d_file, 'verified': False})
|
||||
mapped_dev_paths.add(d_file) # 确保它现在被认为是已映射
|
||||
|
||||
# 步骤 5: 清理重复项
|
||||
initial_len = len(self.mappings)
|
||||
self.remove_duplicates() # 原位修改 self.mappings
|
||||
if len(self.mappings) != initial_len:
|
||||
print(f"信息:移除了 {initial_len - len(self.mappings)} 个重复映射。")
|
||||
made_changes = True
|
||||
|
||||
# 步骤 6: 如果有更改则保存
|
||||
if made_changes:
|
||||
self.save_mappings()
|
||||
print("\\n映射已同步并保存。")
|
||||
else:
|
||||
print("\\n映射文件无需更新。")
|
||||
|
||||
def remove_duplicates(self):
|
||||
"""去除重复的映射"""
|
||||
unique_mappings = []
|
||||
seen = set()
|
||||
|
||||
for mapping in self.mappings:
|
||||
# 创建唯一键
|
||||
key = (mapping.get('plugin_path'), mapping.get('dev_path'))
|
||||
if key not in seen:
|
||||
seen.add(key)
|
||||
unique_mappings.append(mapping)
|
||||
|
||||
self.mappings = unique_mappings
|
||||
|
||||
def show_status(self):
|
||||
"""显示当前状态"""
|
||||
plugin_count = sum(1 for m in self.mappings if m['plugin_path'])
|
||||
dev_count = sum(1 for m in self.mappings if m['dev_path'])
|
||||
both_count = sum(
|
||||
1 for m in self.mappings if m['plugin_path'] and m['dev_path'])
|
||||
|
||||
print("\n当前映射状态:")
|
||||
print(f"总映射数: {len(self.mappings)}")
|
||||
print(f"Plugin 文件: {plugin_count}")
|
||||
print(f"Dev 文件: {dev_count}")
|
||||
print(f"完整映射: {both_count}")
|
||||
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
manager = MdxSyncManager()
|
||||
|
||||
print("开始同步 MDX 文件到映射...")
|
||||
manager.sync_files()
|
||||
manager.show_status()
|
||||
|
||||
print("\n同步完成!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
121
plugin_dev_en/sync/view_file_mappings.py
Normal file
121
plugin_dev_en/sync/view_file_mappings.py
Normal file
@@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
简单的插件映射查看器
|
||||
快速查看文件映射关系,支持在 VS Code 中点击打开
|
||||
"""
|
||||
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
# ANSI 颜色代码
|
||||
GREEN = '\033[92m'
|
||||
YELLOW = '\033[93m'
|
||||
RED = '\033[91m'
|
||||
BLUE = '\033[94m'
|
||||
RESET = '\033[0m'
|
||||
|
||||
# 新增符号常量
|
||||
CHECK_MARK = f"{GREEN}✅{RESET}"
|
||||
CROSS_MARK = f"{RED}❌{RESET}"
|
||||
EMPTY_MARK = f"{YELLOW}❎{RESET}"
|
||||
|
||||
def load_mappings(json_file="plugin_mappings.json"):
|
||||
"""加载映射文件"""
|
||||
# base_dir 是工作区根目录。脚本位于 <workspace_root>/plugin_dev_en/sync/script.py
|
||||
# 因此,base_dir 是脚本目录的父目录的父目录的父目录。
|
||||
base_dir = Path(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
json_path = base_dir / "plugin_dev_en" / "sync" / json_file # 修正 JSON 文件路径
|
||||
|
||||
try:
|
||||
with open(json_path, 'r', encoding='utf-8') as f:
|
||||
return json.load(f)
|
||||
except FileNotFoundError:
|
||||
print(f"{RED}错误: 找不到文件 {json_path}{RESET}")
|
||||
return None
|
||||
except json.JSONDecodeError:
|
||||
print(f"{RED}错误: JSON 文件格式错误{RESET}")
|
||||
return None
|
||||
|
||||
def calculate_statistics(mappings):
|
||||
"""动态计算统计信息"""
|
||||
total = len(mappings)
|
||||
verified = sum(1 for m in mappings if m.get('verified', False))
|
||||
pending = total - verified
|
||||
|
||||
# 额外统计
|
||||
plugin_only = sum(1 for m in mappings if m.get('plugin_path') and not m.get('dev_path'))
|
||||
dev_only = sum(1 for m in mappings if m.get('dev_path') and not m.get('plugin_path'))
|
||||
complete = sum(1 for m in mappings if m.get('plugin_path') and m.get('dev_path'))
|
||||
|
||||
return {
|
||||
'total_mappings': total,
|
||||
'verified_count': verified,
|
||||
'pending_verification': pending,
|
||||
'plugin_only': plugin_only,
|
||||
'dev_only': dev_only,
|
||||
'complete_mappings': complete
|
||||
}
|
||||
|
||||
def show_mappings():
|
||||
"""显示所有映射关系"""
|
||||
data = load_mappings()
|
||||
if not data:
|
||||
return
|
||||
|
||||
mappings = data.get('mappings', [])
|
||||
stats = calculate_statistics(mappings)
|
||||
|
||||
print(f"\n{BLUE}插件文档映射关系{RESET}")
|
||||
print(f"总计: {stats['total_mappings']} | "
|
||||
f"已验证: {GREEN}{stats['verified_count']}{RESET} | "
|
||||
f"待验证: {YELLOW}{stats['pending_verification']}{RESET}")
|
||||
print(f"完整映射: {stats['complete_mappings']} | "
|
||||
f"仅插件: {stats['plugin_only']} | "
|
||||
f"仅开发: {stats['dev_only']}")
|
||||
|
||||
print("\n路径 | 验证 | 同步细节\n")
|
||||
|
||||
separator_line1 = "-" * 56
|
||||
separator_line2 = "*" * 56
|
||||
|
||||
for idx, mapping in enumerate(mappings, 1):
|
||||
plugin_path = mapping.get('plugin_path')
|
||||
dev_path = mapping.get('dev_path')
|
||||
verified = mapping.get('verified', False)
|
||||
sync_info = mapping.get('sync', '').strip()
|
||||
|
||||
# 打印分隔符
|
||||
print(separator_line1)
|
||||
print(separator_line2)
|
||||
print(separator_line1)
|
||||
print() # 在分隔符后添加空行
|
||||
|
||||
# 显示 Help 路径
|
||||
if plugin_path:
|
||||
print(f"Help: {plugin_path}")
|
||||
else:
|
||||
print(f"Help: {EMPTY_MARK}")
|
||||
|
||||
# 显示 Dev 路径
|
||||
if dev_path:
|
||||
print(f"Dev: {dev_path}")
|
||||
else:
|
||||
print(f"Dev: {EMPTY_MARK}")
|
||||
|
||||
# 显示 Verify 状态和 sync_info
|
||||
verify_symbol = CHECK_MARK if verified else CROSS_MARK
|
||||
print(f"Verify: {verify_symbol}")
|
||||
if sync_info:
|
||||
print(sync_info)
|
||||
# No "else" needed here as per example, empty sync_info means just the symbol
|
||||
|
||||
def main():
|
||||
"""主函数"""
|
||||
show_mappings()
|
||||
|
||||
print(f"\n{BLUE}提示:{RESET} 在 VS Code 中,你可以使用 Cmd+点击 路径来快速打开文件")
|
||||
print(f"{BLUE}命令:{RESET} python view_file_mappings.py")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
84
plugin_dev_ja/0111-getting-started-dify-plugin.ja.mdx
Normal file
84
plugin_dev_ja/0111-getting-started-dify-plugin.ja.mdx
Normal file
@@ -0,0 +1,84 @@
|
||||
---
|
||||
dimensions:
|
||||
type:
|
||||
primary: conceptual
|
||||
detail: introduction
|
||||
level: beginner
|
||||
standard_title: Getting Started Dify Plugin
|
||||
language: ja
|
||||
title: Dify プラグイン開発へようこそ
|
||||
description: Difyプラグインの概念、機能、開発価値を紹介し、プラグインタイプ(モデル、ツール、エージェント戦略、エクステンション、バンドル)の簡単な説明と、開発者ドキュメントの内容概覧を含みます。
|
||||
---
|
||||
|
||||
こんにちは!Dify プラグインの構築にご興味をお持ちいただき、大変嬉しく思います。この開発者ドキュメントセンターは、Dify プラグインの学習、作成、デバッグ、公開、管理を支援するための中心的なリソースです。
|
||||
|
||||
**Dify プラグインとは?**
|
||||
|
||||
Dify プラグインは、AI アプリケーションに**強化された認識能力と実行能力**を与えるモジュール式コンポーネントと考えることができます。これらにより、外部サービス、カスタム機能、専用ツールを「プラグアンドプレイ」のシンプルな方法で Dify ベースの AI アプリケーションに統合することが可能になります。プラグインを通じて、AI アプリケーションはより良く「見る」、「聞く」、「話す」、「描く」、「計算する」、「推論する」ことができ、外部 API に接続したり、さらには実世界の操作を実行したりすることができます。
|
||||
|
||||
**プラグイン開発者**として、ご自身の Dify アプリケーション専用の機能拡張を構築したり、あなたのイノベーションを Dify エコシステム全体に貢献して、より多くのユーザーに利益をもたらしたりすることができます。
|
||||
|
||||
**この開発者ドキュメントでは、以下の内容を見つけることができます:**
|
||||
|
||||
このドキュメントは、プラグイン開発者が初めて試す場合でも、高度なカスタマイズを求める場合でも、明確なガイダンスを提供することを目的としています:
|
||||
|
||||
- **[クイックスタート](/plugin_dev_ja/0211-getting-started-dify-tool.ja):** Dify プラグインシステムの基本概念を学び、そのコアアーキテクチャを理解し、開発環境を迅速にセットアップして、最初の「Hello World」プラグインを構築します。
|
||||
- **[コアコンセプト](/plugin_dev_ja/0131-cheatsheet.ja):** プラグインのライフサイクル、セキュリティモデル、エンドポイント統合 (Endpoint Integration)、リバースコール (Reverse Call)、永続ストレージなどの主要な原理を深く理解します。
|
||||
- **さまざまなタイプのプラグイン開発:** 各プラグインタイプに対して、専用の開発ガイドを提供します:
|
||||
- **[モデル (Models)](/plugin_dev_ja/0211-getting-started-new-model.ja):** さまざまな AI モデルをパッケージ化、設定し、プラグインとして管理する方法を学びます。
|
||||
- **[ツール (Tools)](/plugin_dev_ja/0211-getting-started-dify-tool.ja):** データ分析、コンテンツ処理、カスタム統合など、エージェントおよびワークフロー向けの専門的な機能を構築します。
|
||||
- **[エージェント戦略 (Agent Strategies)](/plugin_dev_ja/9433-agent-strategy-plugin.ja):** Dify の自律エージェントを強化するために、カスタムの推論戦略(ReAct, CoT, ToT など)を作成します。
|
||||
- **[エクステンション (Extensions)](/plugin_dev_ja/9231-extension-plugin.ja):** HTTP Webhook を介して外部サービスとの統合を実現し、複雑なロジックを処理します。
|
||||
- **[バンドル (Bundles)](/plugin_dev_ja/9241-bundle.ja):** 複数のプラグインを組み合わせてパッケージ化し、配布とデプロイを容易にする方法を学びます。
|
||||
- **[開発とデバッグ](/plugin_dev_ja/0411-remote-debug-a-plugin.ja):** SDK の使用、使いやすいリモートデバッグ機能の活用、プラグインのテスト方法など、効率的なプラグイン開発のためのツールとテクニックを習得します。
|
||||
- **[公開とマーケットプレイス](/plugin_dev_ja/0321-release-overview.ja):** プラグインをパッケージ化し、公式の Dify Marketplace に提出したり、GitHub などのチャネルを通じてコミュニティと共有したりする方法を学びます。
|
||||
- **[API & SDK リファレンス](/plugin_dev_ja/0411-general-specifications.ja):** API、SDK メソッド、マニフェストファイル形式、および必要なスキーマの詳細な技術仕様を検索します。
|
||||
- **[コミュニティと貢献](/plugin_dev_ja/0312-contributor-covenant-code-of-conduct.ja):** 他の開発者と交流し、助けを求め、Dify プラグインエコシステムとこのドキュメントに貢献する方法を学びます。
|
||||
|
||||
**なぜ Dify プラグインを開発するのか?**
|
||||
|
||||
- **AI 能力の拡張:** Dify ベースのアプリケーションに専門ツール、マルチモーダル処理、実世界サービスへの接続など、無限の可能性を与えます。
|
||||
- **Dify 体験のカスタマイズ:** 専用プラグインを構築することで、特定のビジネスシナリオやワークフローのニーズを正確に満たします。
|
||||
- **インテリジェントプロセスの再構築:** カスタムツールとエージェント戦略を利用して、RAG プロセスを最適化し、エージェントの推論能力を強化します。
|
||||
- **モジュール化と分離の実現:** 機能を独立したプラグインとして開発および管理し、コードの保守性と柔軟性を向上させます。
|
||||
- **Dify ユーザーへのリーチ:** Dify Marketplace を通じて、あなたのイノベーションを広大な Dify ユーザー層と共有します。
|
||||
- **開発者フレンドリーな体験の享受:** 強力な SDK、便利なリモートデバッグツール、明確なドキュメントを提供し、効率的な開発を支援します。
|
||||
|
||||
**構築を始める準備はできましたか?**
|
||||
|
||||
以下は、開始に役立つクイックエントリです:
|
||||
|
||||
- **[クイックスタートガイドを読む](/plugin_dev_ja/0211-getting-started-dify-tool.ja)** - 簡単なツールプラグインの構築から始めましょう
|
||||
- **[プラグイン開発チートシートを見る](/plugin_dev_ja/0131-cheatsheet.ja)** - コアコンセプトとよく使われるコマンドを理解する
|
||||
- **[開発環境の初期化](/plugin_dev_ja/0221-initialize-development-tools.ja)** - 開発環境をセットアップする
|
||||
- **[よくある質問を見る](/plugin_dev_ja/0331-faq.ja)** - よくある疑問を解決する
|
||||
|
||||
## 関連リソース
|
||||
|
||||
- **[モデルプラグイン紹介](/plugin_dev_ja/0131-model-plugin-introduction.ja)** - モデルプラグインの基本構造を理解する
|
||||
- **[開発実践例](/plugin_dev_ja/0432-develop-a-slack-bot-plugin.ja)** - 実際のプラグイン開発事例を見る
|
||||
|
||||
Dify プラグインを使用して素晴らしいアプリケーションや機能を作成されることを楽しみにしています!
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="このページを編集する"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/plugin_dev_ja/0111-getting-started-dify-plugin.ja.mdx"
|
||||
>
|
||||
直接貢献することでドキュメントの改善にご協力ください
|
||||
</Card>
|
||||
<Card
|
||||
title="問題を報告する"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=ドキュメントの問題%3A%20getting-started-dify-plugin&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fplugin_dev_ja%2F0111-getting-started-dify-plugin.ja.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E"
|
||||
>
|
||||
エラーを見つけたり提案がありますか?お知らせください
|
||||
</Card>
|
||||
</CardGroup>
|
||||
166
plugin_dev_ja/0131-cheatsheet.ja.mdx
Normal file
166
plugin_dev_ja/0131-cheatsheet.ja.mdx
Normal file
@@ -0,0 +1,166 @@
|
||||
---
|
||||
dimensions:
|
||||
type:
|
||||
primary: conceptual
|
||||
detail: architecture
|
||||
level: beginner
|
||||
standard_title: Cheatsheet
|
||||
language: ja
|
||||
title: Difyプラグイン開発チートシート
|
||||
description: 環境要件、インストール方法、開発フロー、プラグインの分類と種類、よく使われるコードスニペット、よくある問題の解決策など、Difyプラグイン開発に関する包括的なリファレンスガイドです。開発者が素早く参照するのに適しています。
|
||||
---
|
||||
|
||||
### 環境要件
|
||||
|
||||
- Python バージョン ≥ 3.12
|
||||
- Dify プラグインスケルトンツール (dify-plugin-daemon)
|
||||
|
||||
> 詳細はこちら:[開発ツールの初期化](/plugin_dev_ja/0221-initialize-development-tools.ja)
|
||||
|
||||
### Dify Plugin 開発パッケージの入手
|
||||
|
||||
[Dify Plugin CLI](https://github.com/langgenius/dify-plugin-daemon/releases)
|
||||
|
||||
#### プラットフォーム別のインストール方法
|
||||
|
||||
**macOS [Brew](https://github.com/langgenius/homebrew-dify)(グローバルインストール):**
|
||||
|
||||
```bash
|
||||
brew tap langgenius/dify
|
||||
brew install dify
|
||||
```
|
||||
|
||||
インストール完了後、任意のターミナルウィンドウを新規作成し、`dify version` コマンドを実行します。バージョン情報が出力されれば、インストールは成功です。
|
||||
|
||||
**macOS ARM (Mシリーズチップ):**
|
||||
|
||||
```bash
|
||||
# dify-plugin-darwin-arm64 をダウンロード
|
||||
chmod +x dify-plugin-darwin-arm64
|
||||
./dify-plugin-darwin-arm64 version
|
||||
```
|
||||
|
||||
**macOS Intel:**
|
||||
|
||||
```bash
|
||||
# dify-plugin-darwin-amd64 をダウンロード
|
||||
chmod +x dify-plugin-darwin-amd64
|
||||
./dify-plugin-darwin-amd64 version
|
||||
```
|
||||
|
||||
**Linux:**
|
||||
|
||||
```bash
|
||||
# dify-plugin-linux-amd64 をダウンロード
|
||||
chmod +x dify-plugin-linux-amd64
|
||||
./dify-plugin-linux-amd64 version
|
||||
```
|
||||
|
||||
**グローバルインストール (推奨):**
|
||||
|
||||
```bash
|
||||
# 名前を変更してシステムパスに移動
|
||||
# 例 (macOS ARM)
|
||||
mv dify-plugin-darwin-arm64 dify
|
||||
sudo mv dify /usr/local/bin/
|
||||
dify version
|
||||
```
|
||||
|
||||
### 開発パッケージの実行
|
||||
|
||||
ここでは `dify` を例とします。ローカルインストール方式を使用している場合は、状況に応じてコマンドを置き換えてください。例:`./dify-plugin-darwin-arm64 plugin init`。
|
||||
|
||||
### プラグイン開発フロー
|
||||
|
||||
#### 1. 新規プラグイン作成
|
||||
|
||||
```bash
|
||||
./dify plugin init
|
||||
```
|
||||
|
||||
プロンプトに従ってプラグインの基本情報を設定します
|
||||
|
||||
> 詳細はこちら:[Dify プラグイン開発:Hello World ガイド](/plugin_dev_ja/0211-getting-started-dify-tool.ja)
|
||||
|
||||
#### 2. 開発モードでの実行
|
||||
|
||||
`.env` ファイルを設定し、プラグインディレクトリで以下のコマンドを実行します:
|
||||
|
||||
```bash
|
||||
python -m main
|
||||
```
|
||||
|
||||
> 詳細はこちら:[プラグインのリモートデバッグ](/plugin_dev_ja/0411-remote-debug-a-plugin.ja)
|
||||
|
||||
#### 4. パッケージ化とデプロイ
|
||||
|
||||
プラグインのパッケージ化:
|
||||
|
||||
```bash
|
||||
cd ..
|
||||
dify plugin package ./yourapp
|
||||
```
|
||||
|
||||
> 詳細はこちら:[リリース概要](/plugin_dev_ja/0321-release-overview.ja)
|
||||
|
||||
### プラグインの分類
|
||||
|
||||
#### ツールラベル
|
||||
|
||||
分類 `tag` [class ToolLabelEnum(Enum)](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/entities/tool.py)
|
||||
|
||||
```python
|
||||
class ToolLabelEnum(Enum):
|
||||
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"
|
||||
```
|
||||
|
||||
### プラグインタイプの参照
|
||||
|
||||
Dify は複数のタイプのプラグイン開発をサポートしています:
|
||||
|
||||
- **ツールプラグイン**: サードパーティ API およびサービスを統合
|
||||
> 詳細はこちら:[ツールプラグイン開発](/plugin_dev_ja/0211-getting-started-dify-tool.ja)
|
||||
- **モデルプラグイン**: AI モデルを統合
|
||||
> 詳細はこちら:[モデルプラグイン紹介](/plugin_dev_ja/0131-model-plugin-introduction.ja)、[新しいモデルの迅速な統合](/plugin_dev_ja/0211-getting-started-new-model.ja)
|
||||
- **Agent 戦略プラグイン**: Agent の思考および意思決定戦略をカスタマイズ
|
||||
> 詳細はこちら:[Agent 戦略プラグイン](/plugin_dev_ja/9433-agent-strategy-plugin.ja)
|
||||
- **拡張プラグイン**: Dify プラットフォーム機能を拡張(例:Endpoint および WebAPP)
|
||||
> 詳細はこちら:[拡張プラグイン](/plugin_dev_ja/9231-extension-plugin.ja)
|
||||
|
||||
{/*
|
||||
Contributing Section
|
||||
DO NOT edit this section!
|
||||
It will be automatically generated by the script.
|
||||
*/}
|
||||
|
||||
<CardGroup cols="2">
|
||||
<Card
|
||||
title="このページを編集する"
|
||||
icon="pen-to-square"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/edit/main/plugin_dev_ja/0131-cheatsheet.ja.mdx"
|
||||
>
|
||||
直接貢献することでドキュメントの改善にご協力ください
|
||||
</Card>
|
||||
<Card
|
||||
title="問題を報告する"
|
||||
icon="github"
|
||||
href="https://github.com/langgenius/dify-docs-mintlify/issues/new?title=ドキュメントの問題%3A%20cheatsheet&body=%23%23%20問題の説明%0A%3C%21--%20発見した問題について簡単に説明してください%20--%3E%0A%0A%23%23%20ページリンク%0Ahttps%3A%2F%2Fgithub.com%2Flanggenius%2Fdify-docs-mintlify%2Fblob%2Fmain%2Fplugin_dev_ja%2F0131-cheatsheet.ja.mdx%0A%0A%23%23%20提案される変更%0A%3C%21--%20特定の変更案がある場合は、ここで説明してください%20--%3E%0A%0A%3C%21--%20ドキュメントの品質向上にご協力いただきありがとうございます!%20--%3E"
|
||||
>
|
||||
エラーを見つけたり提案がありますか?お知らせください
|
||||
</Card>
|
||||
</CardGroup>
|
||||
1165
plugin_dev_ja/0211-getting-started-by-prompt.ja.mdx
Normal file
1165
plugin_dev_ja/0211-getting-started-by-prompt.ja.mdx
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user