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:
Christian Gick
2026-02-16 13:02:43 +02:00
parent 6d39038597
commit a80eb6f5b7

2
bot.py
View File

@@ -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}")