[PR #122] [MERGED] feat: support list in JsonMessage #161

Closed
opened 2026-02-15 21:16:01 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langgenius/dify-plugin-sdks/pull/122
Author: @jingfelix
Created: 4/28/2025
Status: Merged
Merged: 5/6/2025
Merged by: @Yeuoly

Base: mainHead: feat/support-list


📝 Commits (1)

  • dd1d09f feat: support list in ToolInvokeMessage.JsonMessage

📊 Changes

2 files changed (+2 additions, -2 deletions)

View changed files

📝 python/dify_plugin/entities/tool.py (+1 -1)
📝 python/dify_plugin/interfaces/tool/__init__.py (+1 -1)

📄 Description

Add type list to JsonMessage. Now Tool.create_json_message can return a list.

class JsonMessage(BaseModel):
    json_object: Mapping | list

    def to_dict(self):
        return {"json_object": self.json_object}

Example:
2025-04-28 20 28 05

Note that corresponding support needs to be added simultaneously in https://github.com/langgenius/dify
Relevent PR in Dify: #19026


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langgenius/dify-plugin-sdks/pull/122 **Author:** [@jingfelix](https://github.com/jingfelix) **Created:** 4/28/2025 **Status:** ✅ Merged **Merged:** 5/6/2025 **Merged by:** [@Yeuoly](https://github.com/Yeuoly) **Base:** `main` ← **Head:** `feat/support-list` --- ### 📝 Commits (1) - [`dd1d09f`](https://github.com/langgenius/dify-plugin-sdks/commit/dd1d09fb79e06ec884de757dd44d6c9733d8280e) feat: support list in ToolInvokeMessage.JsonMessage ### 📊 Changes **2 files changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `python/dify_plugin/entities/tool.py` (+1 -1) 📝 `python/dify_plugin/interfaces/tool/__init__.py` (+1 -1) </details> ### 📄 Description Add type `list` to JsonMessage. Now `Tool.create_json_message` can return a `list`. ```python class JsonMessage(BaseModel): json_object: Mapping | list def to_dict(self): return {"json_object": self.json_object} ``` Example: <img width="200" alt="2025-04-28 20 28 05" src="https://github.com/user-attachments/assets/cffc4337-53e0-4898-8165-2376b555dbfe" /> Note that corresponding support needs to be added simultaneously in [https://github.com/langgenius/dify](https://github.com/langgenius/dify) Relevent PR in Dify: [#19026](https://github.com/langgenius/dify/pull/19026) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 21:16:01 -05:00
yindo closed this issue 2026-02-15 21:16:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugin-sdks#161