mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-05 02:45:28 +00:00
fix: guard AI tidy verdict against non-string LLM output (#1486)
The AI document-tidy endpoint parses verdicts from LLM JSON output and calls .lower().strip() directly. If the model returns null or a non-string element, this crashes with AttributeError. Coerce to str so malformed output is treated as 'keep' instead of crashing.
This commit is contained in:
parent
ac09fb3c57
commit
0a4db4e14b
1 changed files with 1 additions and 1 deletions
|
|
@ -901,7 +901,7 @@ def setup_document_routes(session_manager, upload_handler=None) -> APIRouter:
|
|||
for i, doc in enumerate(batch):
|
||||
if i >= len(verdicts):
|
||||
break
|
||||
verdict = verdicts[i].lower().strip()
|
||||
verdict = str(verdicts[i] or "").lower().strip()
|
||||
if verdict == "junk":
|
||||
doc.tidy_verdict = "junk"
|
||||
db.delete(doc)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue