Skip to content

feat: add multi-select input variable type - #259

Open
ddddajie wants to merge 1 commit into
langgenius:mainfrom
ddddajie:feat/40575-multi-select-input-type
Open

feat: add multi-select input variable type#259
ddddajie wants to merge 1 commit into
langgenius:mainfrom
ddddajie:feat/40575-multi-select-input-type

Conversation

@ddddajie

Copy link
Copy Markdown

Important

  1. Make sure you have read our contribution guidelines
  2. Search existing issues and pull requests to confirm this change is not a duplicate
  3. Open or identify the issue this pull request resolves or advances
  4. Use a Conventional Commits title for this pull request, and mark breaking changes with !
  5. Remember that the pull request title will become the squash merge commit message
  6. If CLA Assistant prompts you, sign CLA.md in the pull request conversation

Related Issue

Related to langgenius/dify#40575

Summary

Add a new MULTI_SELECT member to VariableEntityType so consumers can represent user inputs that allow selecting multiple predefined values.

This is a prerequisite for supporting native multi-select / checkbox-group inputs in Dify Start Nodes.

The change only introduces the input variable type. Existing Graphon array[string] runtime support is reused, so no new segment type or runtime behavior is introduced.

Changes

  • Add VariableEntityType.MULTI_SELECT = "multi-select"
  • Add validation coverage for multi-select VariableEntity
  • Add serialization coverage to ensure the wire value remains "multi-select"

Tests

Targeted tests:

tests/variables/test_input_entities.py

Result:

14 passed

Also verified:

  • VariableEntity.model_validate() accepts "multi-select"
  • model_dump(mode="json") serializes the type as "multi-select"
  • existing SegmentType.ARRAY_STRING support handles typed empty arrays

Checklist

  • This pull request links the issue it advances
  • I have added tests for the change
  • The change is backward compatible

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Aug 20, 2026
@github-actions

github-actions Bot commented Aug 20, 2026

Copy link
Copy Markdown

All contributors on this pull request have signed the CLA.
Posted by the CLA Assistant Lite bot.

@ddddajie

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@ddddajie

Copy link
Copy Markdown
Author

Hi @WH-2099 , could you please take a look at this PR when you have a chance?

This is a small prerequisite for langgenius/dify#40575. It only adds VariableEntityType.MULTI_SELECT while reusing the existing ARRAY_STRING runtime type, with focused validation/serialization coverage (2 files, +25 lines; 14 targeted tests passing; CLA signed).

The Dify-side implementation is already prepared and is currently waiting on this Graphon prerequisite before final integration and the upstream Dify PR.

Happy to make any changes you think are needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant