mirror of
https://github.com/zvx-echo6/recon.git
synced 2026-05-20 06:34:40 +02:00
Fix: Gemini "null" string bug in pdf_processor metadata voting
Same fix as text_processor — Gemini sometimes returns the literal string "null" instead of JSON null for empty metadata fields. The voting logic and Gemini extraction now both treat "null" strings as None. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
f4659d155f
commit
999cf37626
1 changed files with 2 additions and 2 deletions
|
|
@ -181,7 +181,7 @@ def _extract_gemini_metadata(pages_text, config):
|
|||
|
||||
for field in ('title', 'author', 'edition', 'year'):
|
||||
val = data.get(field)
|
||||
if val and isinstance(val, str) and val.strip():
|
||||
if val and isinstance(val, str) and val.strip() and val.strip().lower() != "null":
|
||||
result[field] = val.strip()
|
||||
|
||||
return result
|
||||
|
|
@ -223,7 +223,7 @@ def _vote_metadata(source_a, source_b, source_c):
|
|||
values = {}
|
||||
for name, src in sources.items():
|
||||
val = src.get(field)
|
||||
if val:
|
||||
if val and str(val).strip().lower() != "null":
|
||||
values[name] = val
|
||||
|
||||
if not values:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue