diff --git a/studio/backend/core/rag/parsers/__init__.py b/studio/backend/core/rag/parsers/__init__.py index bc0b613b1e..99e565a123 100644 --- a/studio/backend/core/rag/parsers/__init__.py +++ b/studio/backend/core/rag/parsers/__init__.py @@ -3,9 +3,20 @@ from __future__ import annotations +import re from dataclasses import dataclass, field from pathlib import Path +# Same shape as the chunker's figure-boundary regex but captures the +# figure label (Figure / Fig. / Table / Tab.) AND the number so we can +# attribute a VLM caption back to a specific figure on a multi-figure +# page. +_FIGURE_LINE_RE = re.compile( + r"^(?P\**)(?P