cmd0160's picture
Updating package file structure
18ef2cd
raw
history blame contribute delete
365 Bytes
from typing import Dict
def format_source_label(meta: Dict, index: int) -> str:
"""Create a readable label for a retrieved chunk."""
source = (
meta.get("source")
or meta.get("file_path")
or meta.get("path")
or meta.get("document_id")
or "Unknown source"
)
return f"[{index}] {source}"