first commit

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
陈辅元
2026-07-16 11:12:17 +08:00
co-authored by Cursor
commit 4003624b8c
80 changed files with 9990 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
"""Standalone image parser."""
from __future__ import annotations
import shutil
from pathlib import Path
from rag_cut.models import Block, BlockType
from rag_cut.parsers.base import BaseParser
class ImageParser(BaseParser):
def parse(self, path: Path, assets_dir: Path) -> list[Block]:
assets_dir.mkdir(parents=True, exist_ok=True)
target = assets_dir / path.name
shutil.copy2(path, target)
return [
Block(
type=BlockType.IMAGE,
text=path.stem,
image_id=path.name,
image_path=str(target),
)
]