Skip to content

Conversation

@hjlarry
Copy link
Contributor

@hjlarry hjlarry commented Dec 5, 2025

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

to resolve #29180

depends on langgenius/dify-plugin-sdks#258
depends on langgenius/dify-plugin-daemon#523

Screenshots

test locally:

image image

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Copilot AI review requested due to automatic review settings December 5, 2025 06:47
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Dec 5, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @hjlarry, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces comprehensive support for multi-select inputs across the Dify platform, specifically for tool parameters. It involves significant updates to both the backend's data models and validation logic to accommodate list-based values, as well as corresponding frontend changes to define, render, and manage these new multi-selection capabilities within the user interface. This enhancement provides greater flexibility in configuring tools and workflows.

Highlights

  • Backend Parameter Model Enhancement: The PluginParameter model in the backend has been updated to include a multiple boolean field, indicating if a parameter supports multi-selection, and now allows list as a valid type for default values.
  • Backend Value Casting and Validation: The cast_parameter_value function now correctly handles list inputs for string-based parameter types, and the ToolInput validation logic has been extended to accept list values for constant tool inputs.
  • Frontend Form Schema Update: The CredentialFormSchemaBase type in the frontend now includes an optional multiple property, enabling the definition of multi-select fields in forms.
  • Frontend UI Component Logic: The FormInputItem component has been enhanced to correctly map multi-select inputs to VarType.array and to filter for appropriate array-related variable types, ensuring proper UI behavior and data binding.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot bot added the 💪 enhancement New feature or request label Dec 5, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for multi-select inputs in tools, a valuable feature enhancement. The changes are well-distributed across the Python backend and TypeScript frontend to handle list-based parameter values. The implementation is logical and covers the necessary modifications to data models and value handling. I have a couple of minor suggestions to improve code conciseness in the backend and type safety in the frontend.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds multi-select input support for tool parameters, enabling users to select multiple values from select and dynamic-select fields in workflow tool configurations. The implementation spans both frontend (TypeScript/React) and backend (Python), adding the ability to handle array values for tool parameters that have the multiple flag enabled.

Key Changes

  • Extended type system to support list/array values for multi-select tool parameters
  • Updated frontend variable type mapping to treat multi-select inputs as array types
  • Modified backend validation to accept list values in constant-type tool parameters

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
web/app/components/workflow/nodes/_base/components/form-input-item.tsx Added logic to map multi-select inputs to VarType.array and filter for array variable types when isMultipleSelect is true
web/app/components/header/account-setting/model-provider-page/declarations.ts Added optional multiple field to CredentialFormSchemaBase type definition
api/core/workflow/nodes/tool/entities.py Extended constant type validation to accept list in addition to string, int, float, bool, and dict
api/core/plugin/entities/parameters.py Added multiple field to PluginParameter model and updated cast_parameter_value to handle list values for SELECT/DYNAMIC_SELECT types

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

crazywoola
crazywoola previously approved these changes Dec 9, 2025
Copy link
Member

@crazywoola crazywoola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Yeuoly

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💪 enhancement New feature or request lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support tool multi-select input

3 participants