Repository navigation
feat(tool): support date parameter types - #324
Conversation
There was a problem hiding this comment.
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.
|
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 |
Map date controls to valid prompt schemas across tool selectors and agents. Part of langgenius/dify#36162.
a630045 to
3d6fb82
Compare
WH-2099
left a comment
There was a problem hiding this comment.
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.
Part of langgenius/dify#36162.
Summary
dateanddate-pickertool parameter types.dateto a JSON Schema string for model tool calls.date-pickerto an object with optional stringstartandendproperties.input_schemavalues authoritative.Contract
date-pickervalues 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 -qjust docsjust checkjust testAll checks pass locally: 187 tests passed and 1 integration test was skipped.