from __future__ import annotations from pathlib import Path import re from typing import Any from env.config import SUPPORTED_IMAGE_SUFFIXES # Match headings that the tutoring model is instructed to emit. _SECTION_MARKER_PATTERN = re.compile( r"(?im)^[ \t]*(?:[-*][ \t]*)?(?:#{1,6}[ \t]*)?" r"(?:\*\*)?(?:={2,}[ \t]*)*" r"(?P