debt(D5): agent_outputs 类型标注对齐真实 JSON 形状(list[dict]|dict|None)
- Mapped[list[dict] | dict | None]:multi 模式存专家报告列表, 历史数据/兼容路径可能存 dict;加注释说明形状来源 - 仅类型标注修正,列类型(JSONB)与数据、迁移均不变
This commit is contained in:
+3
-1
@@ -232,7 +232,9 @@ class Prediction(Base):
|
|||||||
raw_response: Mapped[dict | None] = mapped_column(JSONB)
|
raw_response: Mapped[dict | None] = mapped_column(JSONB)
|
||||||
# multi-agent 模式: 各专家报告
|
# multi-agent 模式: 各专家报告
|
||||||
mode: Mapped[str] = mapped_column(String(20), nullable=False, default="single")
|
mode: Mapped[str] = mapped_column(String(20), nullable=False, default="single")
|
||||||
agent_outputs: Mapped[dict | None] = mapped_column(JSONB)
|
# D5: multi-agent 模式存各专家报告列表(list[dict]);历史数据/兼容路径可能存 dict。
|
||||||
|
# 仅修正类型标注与真实 JSON 形状一致,列类型(JSONB)与数据不变。
|
||||||
|
agent_outputs: Mapped[list[dict] | dict | None] = mapped_column(JSONB)
|
||||||
# Fix: agent_weights 独立持久化到列(原本只在 raw_response 中)
|
# Fix: agent_weights 独立持久化到列(原本只在 raw_response 中)
|
||||||
agent_weights: Mapped[dict | None] = mapped_column(JSONB)
|
agent_weights: Mapped[dict | None] = mapped_column(JSONB)
|
||||||
# 预测状态: success / failed / degraded
|
# 预测状态: success / failed / degraded
|
||||||
|
|||||||
Reference in New Issue
Block a user