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