From a80eb6f5b7e0c3b7663bd7ea1b210f5e4f5ca1e5 Mon Sep 17 00:00:00 2001 From: Christian Gick Date: Mon, 16 Feb 2026 13:02:43 +0200 Subject: [PATCH] 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 --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 5ced1a0..5863f30 100644 --- a/bot.py +++ b/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}")