feat(eval): Playground GLM 评分落库并可恢复

在 conversations 表增加 playground_conversation_judge_json,流式/非流式对话评审结束后写入最近一次快照(整体分、逐轮分、对比文案、错误与基线文件名等)。新增只读 GET 供前端按会话拉取;评测台 Playground 切换会话时自动恢复,并提示基线是否和当时一致。
This commit is contained in:
Kevin
2026-04-08 16:50:53 +08:00
parent 309a051038
commit 78b61c076e
8 changed files with 361 additions and 91 deletions

View File

@@ -3,6 +3,7 @@
from __future__ import annotations
from dataclasses import dataclass
from typing import Any
from sqlalchemy.ext.asyncio import AsyncSession
@@ -110,3 +111,12 @@ class SessionCatalogService:
user_utterances_from_segments=from_segments,
user_utterances_from_messages=from_messages,
)
async def get_playground_conversation_judge_json(
self, conversation_id: str
) -> dict[str, Any] | None:
c = await self._repo.get_conversation(conversation_id)
if not c or c.deleted_at:
return None
raw = c.playground_conversation_judge_json
return raw if isinstance(raw, dict) else None