dify/web/app/components/base/chat
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
..
__tests__ fix: Fix lodash module not found issue (#16953) 2025-04-01 12:16:49 +08:00
chat refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
chat-with-history Fix/add webapp no permission page (#20819) 2025-06-09 15:44:49 +08:00
embedded-chatbot feat: Embedded chat window supports userVariables configuration. (#20983) 2025-06-18 14:27:02 +08:00
constants.ts feat: regenerate in Chat, agent and Chatflow app (#7661) 2024-09-22 03:15:11 +08:00
types.ts feat(logAndAnn): add control option for question editing feature (#19117) 2025-04-30 10:57:23 +08:00
utils.ts feat: Embedded chat window supports userVariables configuration. (#20983) 2025-06-18 14:27:02 +08:00