This commit is contained in:
team3
2026-07-04 03:25:02 +02:00
parent c4caf31ed0
commit 2f5d5b9ca1
11 changed files with 176 additions and 18 deletions

View File

@@ -1,5 +1,6 @@
import asyncio
import json
import logging
import shutil
import uuid
from datetime import datetime, timedelta, timezone
@@ -173,7 +174,20 @@ async def run_qa_route(req: QaRunRequest):
if report is None:
raise HTTPException(status_code=404, detail="keine fertigen Bausteine")
await asyncio.to_thread(qa._write_report, report)
return {"note": report["note"], "note_artefakte": report["note_artefakte"]}
note_guide = None
try: # fertiger Guide vorhanden → mitmessen (ein Klick, drei Noten); best-effort
import guide_qa
from database import list_guide_cards
if any(c["stage"] == "done" and (c.get("md") or "").strip()
for c in await list_guide_cards(req.topic)):
grep = await guide_qa.guide_qa_report(req.topic, llm=req.llm)
if grep:
await asyncio.to_thread(guide_qa._write_report, grep)
note_guide = grep["note_guide"]
except Exception:
logging.getLogger("creator.routes").exception("[%s] Guide-QA im QA-Button fehlgeschlagen", req.topic)
return {"note": report["note"], "note_artefakte": report["note_artefakte"],
"note_guide": note_guide}
finally:
_qa_laeuft.discard(req.topic)