fix(diarization-ui): have _job_get return dict instead of sqlite3.Row
sqlite3.Row does not support .get() — converting to dict at the source fixes all current and future call sites uniformly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
5
app.py
5
app.py
@@ -280,7 +280,8 @@ def get_prompts():
|
|||||||
|
|
||||||
def _job_get(job_id: int):
|
def _job_get(job_id: int):
|
||||||
with db() as c:
|
with db() as c:
|
||||||
return c.execute("SELECT * FROM jobs WHERE id=?", (job_id,)).fetchone()
|
row = c.execute("SELECT * FROM jobs WHERE id=?", (job_id,)).fetchone()
|
||||||
|
return dict(row) if row else None
|
||||||
|
|
||||||
|
|
||||||
def _job_set(job_id: int, **fields):
|
def _job_set(job_id: int, **fields):
|
||||||
@@ -348,7 +349,7 @@ def _process_analysis_job(job_id: int):
|
|||||||
if not doc or not prm:
|
if not doc or not prm:
|
||||||
raise RuntimeError("Dokument oder Prompt nicht gefunden")
|
raise RuntimeError("Dokument oder Prompt nicht gefunden")
|
||||||
|
|
||||||
user_extra = (j["user_prompt"] or "").strip() if j["user_prompt"] is not None else ""
|
user_extra = (j.get("user_prompt") or "").strip()
|
||||||
llm_prompt = (
|
llm_prompt = (
|
||||||
"Du bist ein präziser Assistent. Antworte auf Deutsch.\\n"
|
"Du bist ein präziser Assistent. Antworte auf Deutsch.\\n"
|
||||||
f"AUFTRAG:\\n{prm['prompt']}\\n"
|
f"AUFTRAG:\\n{prm['prompt']}\\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user