Dify tool plugin parameter type model-selector set faild #13274

Closed
opened 2026-02-21 19:11:24 -05:00 by yindo · 3 comments
Owner

Originally created by @jqhr on GitHub (Apr 23, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, 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).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.2.0

Cloud or Self Hosted

Cloud

Steps to reproduce

I'm develop an tool plugin which need call llm model, but cannot set it in workflow tool config panel.
Here is my tool config yaml:

identity:
  name: docx_polish
  author: jingqian
  label:
    en_US: docx polish
    zh_Hans: docx修改段落文字
    pt_BR: docx polish
description:
  human:
    en_US: docx修改段落文字
    zh_Hans: docx修改段落文字
    pt_BR: docx修改段落文字
  llm: docx修改段落文字,并返回润色后的docx文件
parameters:
  - name: file
    type: file
    required: true
    label:
      en_US: docx
      zh_Hans: docx文件
      pt_BR: docx
    human_description:
      en_US: docx文件
      zh_Hans: docx文件
      pt_BR: docx文件
    llm_description: docx文件
    form: llm
  - name: model
    type: model-selector
    scope: llm
    required: true
    label:
      en_US: model
      zh_Hans: 模型
      pt_BR: model
    human_description:
      en_US: 模型
      zh_Hans: 模型
      pt_BR: 模型
    llm_description: 模型
    form: llm
  - name: prompt
    type: string
    required: false
    label:
      en_US: prompt
      zh_Hans: 提示词
      pt_BR: prompt
    human_description:
      en_US: 提示词
      zh_Hans: 提示词
      pt_BR: 提示词
    llm_description: 提示词
    form: llm
extra:
  python:
    source: tools/docx_polish.py

When I config my tool node in workflow, I have set the model, but cannot run and publish.

Image

✔️ Expected Behavior

Except it could be set.

Actual Behavior

Image

Originally created by @jqhr on GitHub (Apr 23, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.2.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce I'm develop an tool plugin which need call llm model, but cannot set it in workflow tool config panel. Here is my tool config yaml: ```yaml identity: name: docx_polish author: jingqian label: en_US: docx polish zh_Hans: docx修改段落文字 pt_BR: docx polish description: human: en_US: docx修改段落文字 zh_Hans: docx修改段落文字 pt_BR: docx修改段落文字 llm: docx修改段落文字,并返回润色后的docx文件 parameters: - name: file type: file required: true label: en_US: docx zh_Hans: docx文件 pt_BR: docx human_description: en_US: docx文件 zh_Hans: docx文件 pt_BR: docx文件 llm_description: docx文件 form: llm - name: model type: model-selector scope: llm required: true label: en_US: model zh_Hans: 模型 pt_BR: model human_description: en_US: 模型 zh_Hans: 模型 pt_BR: 模型 llm_description: 模型 form: llm - name: prompt type: string required: false label: en_US: prompt zh_Hans: 提示词 pt_BR: prompt human_description: en_US: 提示词 zh_Hans: 提示词 pt_BR: 提示词 llm_description: 提示词 form: llm extra: python: source: tools/docx_polish.py ``` When I config my tool node in workflow, I have set the model, but cannot run and publish. ![Image](https://github.com/user-attachments/assets/a3393dae-8cec-483e-8b57-8f009f52deb2) ### ✔️ Expected Behavior Except it could be set. ### ❌ Actual Behavior ![Image](https://github.com/user-attachments/assets/7e5d6ecb-4ab9-4870-a3eb-1c710aa2c56a)
yindo added the 🐞 bug label 2026-02-21 19:11:24 -05:00
yindo closed this issue 2026-02-21 19:11:24 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 23, 2025):

To resolve the issue with the model-selector parameter in your Dify tool plugin configuration, you need to adjust the form field in your YAML configuration. The form field for the model parameter should be set to form instead of llm. Here is the corrected configuration for the model parameter:

parameters:
  - name: model
    type: model-selector
    scope: llm
    required: true
    label:
      en_US: model
      zh_Hans: 模型
      pt_BR: model
    human_description:
      en_US: 模型
      zh_Hans: 模型
      pt_BR: 模型
    llm_description: 模型
    form: form

This change ensures that the model can be set by the user in the workflow tool configuration panel, resolving the "model cannot be empty" error [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 23, 2025): <!-- Answer --> To resolve the issue with the `model-selector` parameter in your Dify tool plugin configuration, you need to adjust the `form` field in your YAML configuration. The `form` field for the `model` parameter should be set to `form` instead of `llm`. Here is the corrected configuration for the `model` parameter: ```yaml parameters: - name: model type: model-selector scope: llm required: true label: en_US: model zh_Hans: 模型 pt_BR: model human_description: en_US: 模型 zh_Hans: 模型 pt_BR: 模型 llm_description: 模型 form: form ``` This change ensures that the model can be set by the user in the workflow tool configuration panel, resolving the "model cannot be empty" error <sup>[[1]](https://github.com/langgenius/dify/issues/15631)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/e2bfdbfa-719f-47dd-843d-68c4bb486553?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/e2bfdbfa-719f-47dd-843d-68c4bb486553?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/e2bfdbfa-719f-47dd-843d-68c4bb486553?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/e2bfdbfa-719f-47dd-843d-68c4bb486553?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/e2bfdbfa-719f-47dd-843d-68c4bb486553?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/e2bfdbfa-719f-47dd-843d-68c4bb486553?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/e2bfdbfa-719f-47dd-843d-68c4bb486553?feedback_type=other)</sup>
Author
Owner

@jqhr commented on GitHub (Apr 23, 2025):

OK,
I will try it

@jqhr commented on GitHub (Apr 23, 2025): OK, I will try it
Author
Owner

@jqhr commented on GitHub (Apr 23, 2025):

OK, it works!

@jqhr commented on GitHub (Apr 23, 2025): OK, it works!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13274