fix: Read source_url from top-level field in RAG response
source_url is now a top-level field on DocumentChunk, not nested in metadata. Fall back to metadata for backwards compatibility. Refs: WF-90 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2
bot.py
2
bot.py
@@ -106,7 +106,7 @@ class DocumentRAG:
|
||||
filename = r.get("metadata", {}).get("original_filename", "")
|
||||
category = r.get("category", "")
|
||||
date = r.get("detected_date", "")
|
||||
link = r.get("metadata", {}).get("source_url", "")
|
||||
link = r.get("source_url") or r.get("metadata", {}).get("source_url", "")
|
||||
parts.append(f"- Title: {title}")
|
||||
if filename:
|
||||
parts.append(f" Filename: {filename}")
|
||||
|
||||
Reference in New Issue
Block a user