Skip to content

add param type date and date-picker#733

Open
zyqzyq wants to merge 1 commit into
langgenius:mainfrom
zyqzyq:feat/add_param_data_picker
Open

add param type date and date-picker#733
zyqzyq wants to merge 1 commit into
langgenius:mainfrom
zyqzyq:feat/add_param_data_picker

Conversation

@zyqzyq
Copy link
Copy Markdown

@zyqzyq zyqzyq commented May 14, 2026

Description

Fixes langgenius/dify#36162

tool plugin add type date and date-picker

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • Other

Essential Checklist

Testing

  • I have tested the changes locally and confirmed they work as expected
  • I have added unit tests where necessary and they pass successfully

Bug Fix (if applicable)

  • I have used GitHub syntax to close the related issue (e.g., Fixes #123 or Closes #123)

Additional Information

Please provide any additional context that would help reviewers understand the changes.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request plugin-daemon labels May 14, 2026
Copy link
Copy Markdown
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 DATE and DATE_PICKER as new tool parameter types and updates the validation logic. The review feedback points out that the existing ToolParameter struct cannot enforce date range constraints due to its float64 fields and lacks format validation for default values. Additionally, it is suggested to evaluate if both types are necessary to avoid redundancy.

TOOL_PARAMETER_ARRAY ToolParameterType = ARRAY
TOOL_PARAMETER_OBJECT ToolParameterType = OBJECT
TOOL_PARAMETER_TYPE_CHECKBOX ToolParameterType = CHECKBOX
TOOL_PARAMETER_TYPE_DATE ToolParameterType = DATE
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The addition of the DATE type highlights a limitation in the ToolParameter struct (line 128), where Min and Max are defined as *float64. These fields cannot be used to enforce date range constraints. Additionally, there is currently no validation for the Default value to ensure it follows a specific format (e.g., ISO 8601). Consider updating the validation logic to support these requirements for date-related types.

TOOL_PARAMETER_OBJECT ToolParameterType = OBJECT
TOOL_PARAMETER_TYPE_CHECKBOX ToolParameterType = CHECKBOX
TOOL_PARAMETER_TYPE_DATE ToolParameterType = DATE
TOOL_PARAMETER_TYPE_DATE_PICKER ToolParameterType = DATE_PICKER
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Consider whether both DATE and DATE_PICKER are necessary as distinct types. If they both represent a date string and the difference is purely a UI hint, it might be more maintainable to have a single DATE type. This avoids redundancy in the type system and simplifies the logic for consumers of these parameters.

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: tool plugin add date and date-picker type

1 participant