You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/develop-plugin/dev-guides-and-walkthroughs/develop-a-slack-bot-plugin.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,7 +161,7 @@ extra:
161
161
source: "endpoints/slack.py"
162
162
```
163
163
164
-
#### 2. Edit the function code
164
+
### 2. Edit the function code
165
165
166
166
Modify the `endpoints/slack.py` file and add the following code:
167
167
@@ -240,7 +240,7 @@ class SlackEndpoint(Endpoint):
240
240
return Response(status=200, response="ok")
241
241
```
242
242
243
-
### 2. Debug the Plugin
243
+
### 3. Debug the Plugin
244
244
245
245
Go to the Dify platform and obtain the remote debugging address and key for your plugin.
246
246
@@ -291,15 +291,15 @@ Next, complete the Slack App setup:
291
291
292
292
---
293
293
294
-
### 3. Verify the Plugin
294
+
### 4. Verify the Plugin
295
295
296
296
In your code, `self.session.app.chat.invoke` is used to call the Dify application, passing in parameters such as `app_id` and `query`. The response is then returned to the Slack Bot. Run `python -m main` again to restart your plugin for debugging, and check whether Slack correctly displays the Dify App’s reply:
Once you confirm that the plugin works correctly, you can package and name it via the following command. After it runs, you’ll find a `slack_bot.difypkg` file in the current directory—your final plugin package. For detailed packaging steps, refer to [Package as a Local File and Share](/en/develop-plugin/publishing/marketplace-listing/release-by-file).
305
305
@@ -313,7 +313,7 @@ Congratulations! You’ve successfully developed, tested, and packaged a plugin!
313
313
314
314
---
315
315
316
-
### 5. Publish the Plugin (Optional)
316
+
### 6. Publish the Plugin (Optional)
317
317
318
318
You can now upload it to the [Dify Marketplace repository](https://github.com/langgenius/dify-plugins) for public release. Before publishing, ensure your plugin meets the [Publishing to Dify Marketplace Guidelines](/en/develop-plugin/publishing/marketplace-listing/release-to-dify-marketplace). Once approved, your code is merged into the main branch, and the plugin goes live on the [Dify Marketplace](https://marketplace.dify.ai/).
Copy file name to clipboardExpand all lines: en/develop-plugin/dev-guides-and-walkthroughs/tool-plugin.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,7 +291,7 @@ class GoogleSearchTool(Tool):
291
291
292
292
This example means requesting `serpapi` and using `self.create_json_message` to return a formatted `json` data string. If you want to learn more about return data types, you can refer to the [Remote Debugging Plugins](/en/develop-plugin/features-and-specs/plugin-types/remote-debug-a-plugin) and [Persistent Storage KV](/en/develop-plugin/features-and-specs/plugin-types/persistent-storage-kv) documents.
293
293
294
-
#### 4. Completing the Tool Provider Code
294
+
#### 5. Completing the Tool Provider Code
295
295
296
296
Finally, you need to create an implementation code for the provider to implement the credential validation logic. If credential validation fails, a `ToolProviderCredentialValidationError` exception will be thrown. After validation succeeds, the `google_search` tool service will be correctly requested.
0 commit comments