feat: persist single evaluation history

This commit is contained in:
wuyang6
2026-07-23 19:46:15 +08:00
parent 5be9434ba3
commit 6116d10e8f
5 changed files with 398 additions and 13 deletions
+21
View File
@@ -1554,6 +1554,27 @@ def create_app(state: AgentState) -> FastAPI:
except EvaluationError as exc:
raise HTTPException(status_code=400, detail=str(exc)) from exc
@app.get('/api/evaluations/analyses')
async def list_evaluation_analyses(
account_id: str,
) -> list[dict[str, Any]]:
return state.evaluation_runtime.list_single_analyses(
_safe_account_id(account_id)
)
@app.get('/api/evaluations/analyses/{analysis_id}')
async def get_evaluation_analysis(
analysis_id: str,
account_id: str,
) -> dict[str, Any]:
try:
return state.evaluation_runtime.get_single_analysis(
analysis_id,
_safe_account_id(account_id),
)
except EvaluationError as exc:
raise HTTPException(status_code=404, detail=str(exc)) from exc
@app.get('/api/evaluations/datasets')
async def list_evaluation_datasets(account_id: str) -> list[dict[str, Any]]:
return state.evaluation_runtime.list_datasets(_safe_account_id(account_id))