mirror of https://github.com/langgenius/dify.git
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. |
||
|---|---|---|
| .. | ||
| agent/output_parser | ||
| app | ||
| file | ||
| helper | ||
| mcp/client | ||
| model_runtime | ||
| ops | ||
| prompt | ||
| rag | ||
| repositories | ||
| tools | ||
| variables | ||
| workflow | ||
| __init__.py | ||
| test_file.py | ||
| test_model_manager.py | ||
| test_provider_manager.py | ||