dify/api/core/app
QuantumGhost 2c1ab4879f
refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025)
refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025)

This PR addresses serialization issues in the VariablePool model by separating the `value_type` tags for `IntegerSegment`/`FloatSegment` and `IntegerVariable`/`FloatVariable`. Previously, both Integer and Float types shared the same `SegmentType.NUMBER` tag, causing conflicts during serialization.

Key changes:
- Introduce distinct `value_type` tags for Integer and Float segments/variables
- Add `VariableUnion` and `SegmentUnion` types for proper type discrimination
- Leverage Pydantic's discriminated union feature for seamless serialization/deserialization
- Enable accurate serialization of data structures containing these types

Closes #22024.
2025-07-16 12:31:37 +08:00
..
app_config feat: Persist Variables for Enhanced Debugging Workflow (#20699) 2025-06-24 09:05:29 +08:00
apps refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
entities feat: Persist Variables for Enhanced Debugging Workflow (#20699) 2025-06-24 09:05:29 +08:00
features feat: Skip Redis operations if RateLimit is disabled (#12226) 2025-03-21 19:55:27 +08:00
task_pipeline moving the `MessageStatus` class from the `models.model` module to `models.enums` module (#21867) 2025-07-03 13:56:23 +08:00
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00