Skip to content

feat(tool): support date parameter types - #324

Merged
WH-2099 merged 1 commit into
langgenius:mainfrom
zyqzyq:feat/add_date_picker
Aug 4, 2026
Merged

WH-2099 merged 1 commit into
langgenius:mainfrom
zyqzyq:feat/add_date_picker

Conversation

@zyqzyq

@zyqzyq zyqzyq commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

Part of langgenius/dify#36162.

Summary

  • Add date and date-picker tool parameter types.
  • Map date to a JSON Schema string for model tool calls.
  • Map date-picker to an object with optional string start and end properties.
  • Reuse the same conversion for tool selectors and agent strategies.
  • Keep explicit input_schema values authoritative.
  • Keep provider credential configuration unchanged.

Contract

date-picker values are normalized to {start?: string, end?: string} by the proposed Dify integration in langgenius/dify#36163.

This SDK does not add ISO date validation or range ordering before that contract is defined at the shared input boundary.

Related daemon support is tracked by langgenius/dify-plugin-daemon#733.

Validation

  • uv run pytest tests/entities/test_tool.py tests/interfaces/agent/test_agent.py -q
  • just docs
  • just check
  • just test

All checks pass locally: 187 tests passed and 1 integration test was skipped.

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

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.

Code Review

This pull request introduces DATE and DATE_PICKER parameter types to the CommonParameterType and ToolParameterType enums. Feedback indicates that these new types need to be correctly mapped to standard JSON Schema types (e.g., "string") within the LLM translation logic to prevent compatibility issues with model providers. Additionally, it is recommended to include these types in the ProviderConfig.Config enum to ensure they are available for use in provider credentials and configuration schemas.

Comment thread src/dify_plugin/entities/tool.py Resolved
@WH-2099 WH-2099 self-assigned this Jul 31, 2026
@WH-2099 WH-2099 changed the title add param type date and date-picker feat(tool): support date parameter types Jul 31, 2026
@WH-2099

WH-2099 commented Jul 31, 2026

Copy link
Copy Markdown
Member

Blocked on upstream contract confirmation, so I am intentionally not pushing speculative SDK changes.

Once those contracts are accepted, the smallest complete update here is to map the UI types to valid JSON Schema in both ToolSelector.to_prompt_message() and AgentStrategy._set_prompt_tool_parameter(), then add focused coverage in tests/entities/test_tool.py and tests/interfaces/agent/test_agent.py. ProviderConfig.Config will remain unchanged because it models provider credential controls, not tool parameters.

Map date controls to valid prompt schemas across tool selectors and agents.

Part of langgenius/dify#36162.
@WH-2099
WH-2099 force-pushed the feat/add_date_picker branch from a630045 to 3d6fb82 Compare August 4, 2026 10:08

@WH-2099 WH-2099 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the complete SDK flow. Date controls now produce valid prompt schemas in both conversion paths, explicit input schemas remain authoritative, ToolSelector properties are correctly nested, all review threads are resolved, and all four CI checks pass.

@WH-2099
WH-2099 merged commit 6861bd8 into langgenius:main Aug 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants