fix(cleaning): final fix for indentation and string literal syntax in description enrichment

This commit is contained in:
Nubenetes Bot
2026-05-16 12:06:48 +02:00
parent cfc0b2bb94
commit 87da5e9490

View File

@@ -191,7 +191,7 @@ class IntelligentLinkCleaner:
except: pass
return url, True, None, "Conservative Keep"
async def _enrich_description_if_needed(self, url: str):
async def _enrich_description_if_needed(self, url: str):
"""
Policy Update: We NO LONGER enrich existing V1 descriptions in the repo
to respect manual curation. However, we ensure the INVENTORY has a
@@ -210,12 +210,10 @@ class IntelligentLinkCleaner:
web_content = await _deep_fetch_content(url)
if not web_content: return
prompt = (
f"Analyze this resource: {url}\n"
f"Technical Content Snippet: {web_content[:1500]}\n"
"Provide: 1) A professional 1-sentence English description. 2) The precise original PUBLICATION DATE (YYYY-MM-DD or YYYY if possible).\n"
"Format: JSON: {\"desc\": \"...\", \"pub_date\": \"...\"}"
)
prompt = f"""Analyze this resource: {url}
Technical Content Snippet: {web_content[:1500]}
Provide: 1) A professional 1-sentence English description. 2) The precise original PUBLICATION DATE (YYYY-MM-DD or YYYY if possible).
Format: JSON: {\"desc\": \"...\", \"pub_date\": \"...\"}"""
ai_data = await call_gemini_with_retry(prompt)
if ai_data:
self.inventory[norm_url]["ai_summary"] = ai_data.get("desc", "").strip()