自定义工具的参数中不支持Array[String]类型. #2269

Closed
opened 2026-02-21 17:43:43 -05:00 by yindo · 0 comments
Owner

Originally created by @gaoshan5211 on GitHub (Apr 17, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a quesion, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

Dify version

0.6.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

自定义工具中方法的参数似乎不支持Array[string]

即使在schema中定义了参数type为array,items.type为string.但是工具中仍然会识别为string.
自定义工具的schema:

{
    "platform": {
        "type": "array",
        "items": {
            "type": "string"
        },
        "description": "Platform filter for the search. weibo:微博; weixin:微信公众号; news:新闻媒体; short_video:短视频; blog:博客; forum:论坛"
    }
}

✔️ Expected Behavior

自定义工具的参数类型也应该是 Array[string]
platform: Array[string]

Actual Behavior

但是自定义工具后, 依然是string类型
image

在后续的工作流编辑时,即使上一步输出了 array[string] 类型结果, 会因为参数类型不同, 无法选择参数.
image

工具schema和workflow.yml

tools_schema.txt
workflow_yml.txt

Originally created by @gaoshan5211 on GitHub (Apr 17, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a quesion, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Pleas do not modify this template :) and fill in all the required fields. ### Dify version 0.6.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ## 自定义工具中方法的参数似乎不支持Array[string] 即使在schema中定义了参数type为array,items.type为string.但是工具中仍然会识别为string. 自定义工具的schema: ``` { "platform": { "type": "array", "items": { "type": "string" }, "description": "Platform filter for the search. weibo:微博; weixin:微信公众号; news:新闻媒体; short_video:短视频; blog:博客; forum:论坛" } } ``` ### ✔️ Expected Behavior 自定义工具的参数类型也应该是 Array[string] platform: Array[string] ### ❌ Actual Behavior 但是自定义工具后, 依然是string类型 ![image](https://github.com/langgenius/dify/assets/6259894/ea8342d5-0aeb-4c57-be72-5674fe872d42) 在后续的工作流编辑时,即使上一步输出了 array[string] 类型结果, 会因为参数类型不同, 无法选择参数. ![image](https://github.com/langgenius/dify/assets/6259894/0eca1b86-1788-44db-99a3-77f57ed9c4ba) ## 工具schema和workflow.yml [tools_schema.txt](https://github.com/langgenius/dify/files/15006828/tools_schema.txt) [workflow_yml.txt](https://github.com/langgenius/dify/files/15006833/workflow_yml.txt)
yindo added the 🐞 bug label 2026-02-21 17:43:43 -05:00
yindo closed this issue 2026-02-21 17:43:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#2269