dify/api/core/workflow/entities
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
..
__init__.py FEAT: NEW WORKFLOW ENGINE (#3160) 2024-04-08 18:51:46 +08:00
node_entities.py refactor(workflow): Rename NodeRunMetadataKey to WorkflowNodeExecutionMetadataKey (#20457) 2025-05-30 04:47:56 +08:00
variable_entities.py feat/enhance the multi-modal support (#8818) 2024-10-21 10:43:49 +08:00
variable_pool.py refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
workflow_entities.py Feature/newnew workflow loop node (#14863) 2025-03-05 17:41:15 +08:00
workflow_execution.py Refactor/remove db from cycle manager (#20455) 2025-05-30 04:34:13 +08:00
workflow_node_execution.py fix(api): Fix resetting sys var causing internal server error (#21604) 2025-07-02 13:36:35 +08:00