dify/api/core
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
..
agent feat(api/repo): Allow to config repository implementation (#21458) 2025-07-14 14:54:38 +08:00
app refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
base refactor: Remove RepositoryFactory (#19176) 2025-05-06 21:14:51 +08:00
callback_handler Refactor/message cycle manage and knowledge retrieval (#20460) 2025-05-30 14:36:44 +08:00
entities feat: add MCP support (#20716) 2025-07-10 14:01:34 +08:00
errors fix(core/errors): change base class of custom exceptions to ValueError (#11955) 2024-12-22 10:41:34 +08:00
extension refactor: Improve model status handling and structured output (#20586) 2025-06-04 19:56:54 +08:00
external_data_tool Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 2025-04-29 18:04:33 +08:00
file fix: resolve Docker file URL networking issue for plugins (#21334) (#21382) 2025-07-11 12:11:59 +08:00
helper fix: code result included "error" field (#22392) 2025-07-15 13:55:00 +08:00
llm_generator fix: add list contents handling in structured LLM output (#21837) 2025-07-02 19:14:21 +08:00
mcp minor fix: using Pydantic model_validate instead of deprecated parse_obj (#22239) 2025-07-16 10:57:08 +08:00
memory feat(api/repo): Allow to config repository implementation (#21458) 2025-07-14 14:54:38 +08:00
model_runtime feat: add support for dark icons in provider and tool entities (#22081) 2025-07-10 14:43:31 +08:00
moderation Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 2025-04-29 18:04:33 +08:00
ops improve opik workflow_trace span name to node name (#22356) 2025-07-15 09:33:06 +08:00
plugin fix(plugin): introduce response_type parameter in plugin list API to enable paginated response support (#22251) 2025-07-15 10:10:37 +08:00
prompt refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
rag tablestore vector support more method (#22225) 2025-07-15 09:58:48 +08:00
repositories feat(api/repo): Allow to config repository implementation (#21458) 2025-07-14 14:54:38 +08:00
tools fix: generate deterministic operationId for root endpoints without one (#19888) 2025-07-15 14:19:55 +08:00
variables refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
workflow refactor(api): Separate SegmentType for Integer/Float to Enable Pydantic Serialization (#22025) 2025-07-16 12:31:37 +08:00
__init__.py chore(api/core): apply ruff reformatting (#7624) 2024-09-10 17:00:20 +08:00
hosting_configuration.py chore(provider_manager): Update hosted model's name (#14334) 2025-02-25 18:47:33 +08:00
indexing_runner.py fix: document delete image files check file exist (#21991) 2025-07-07 21:53:40 +08:00
model_manager.py unreachable-code for lb model fetch. (#20797) 2025-06-18 14:33:49 +08:00
provider_manager.py refactor: Improve model status handling and structured output (#20586) 2025-06-04 19:56:54 +08:00