dify/web/app/components/base/chat/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
..
answer fix: autocorrect everything in web (#20605) 2025-06-04 14:12:24 +08:00
chat-input-area fix: some dark mode display incorrect (#20788) 2025-06-09 16:09:27 +08:00
citation Chore: frontend infrastructure upgrade (#16420) 2025-03-21 17:41:03 +08:00
loading-anim Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 2025-04-29 18:04:33 +08:00
log Chore: frontend infrastructure upgrade (#16420) 2025-03-21 17:41:03 +08:00
thought Chore/cleanup warnings (#17974) 2025-04-14 11:27:14 +08:00
check-input-forms-hooks.ts Feat/attachments (#9526) 2024-10-21 10:32:37 +08:00
content-switch.tsx feat: edit question in Chat (#17961) 2025-04-15 15:37:08 +08:00
context.tsx Feat/attachments (#9526) 2024-10-21 10:32:37 +08:00
hooks.ts feat: support var in suggested questions (#17340) 2025-07-11 15:07:32 +08:00
index.tsx fix: web error (#21340) 2025-06-23 13:54:52 +08:00
question.stories.tsx Chore: frontend infrastructure upgrade (#16420) 2025-03-21 17:41:03 +08:00
question.tsx refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
try-to-ask.tsx Chore: frontend infrastructure upgrade (#16420) 2025-03-21 17:41:03 +08:00
type.ts feat: support chatflow start node custom input field hidden (#19678) 2025-05-21 13:52:21 +08:00
utils.ts fix: with file conversation second chat raise error (#15097) 2025-03-06 18:21:40 +08:00