(
*,
image_path: Path | None = None,
image_paths: list[Path] | tuple[Path, ...] | None = None,
)
| 42 | |
| 43 | |
| 44 | def _normalize_image_paths( |
| 45 | *, |
| 46 | image_path: Path | None = None, |
| 47 | image_paths: list[Path] | tuple[Path, ...] | None = None, |
| 48 | ) -> list[Path]: |
| 49 | normalized = list(image_paths or []) |
| 50 | if image_path is not None: |
| 51 | normalized.insert(0, image_path) |
| 52 | if not normalized: |
| 53 | raise ValueError("At least one image path is required.") |
| 54 | return normalized |
| 55 | |
| 56 | |
| 57 | def _parse_json_response(raw_text: str) -> dict[str, Any]: |