Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion astrbot/core/knowledge_base/parsers/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@


async def select_parser(ext: str) -> BaseParser:
if ext in {".md", ".txt", ".markdown", ".rst", ".adoc", ".xlsx", ".docx", ".xls"}:
if ext in {".md", ".txt", ".markdown"}:
# Plain text formats are decoded directly by TextParser and do not
# require the optional markitdown dependency. Routing them here keeps
# txt/md uploads working even when markitdown-no-magika is missing
# (see https://github.com/AstrBotDevs/AstrBot/issues/9598).
from .text_parser import TextParser

return TextParser()
if ext in {".rst", ".adoc", ".xlsx", ".docx", ".xls"}:
from .markitdown_parser import MarkitdownParser

return MarkitdownParser()
Expand Down
Loading